Newer
Older
<?php
/**
* Created by PhpStorm.
* User: ep
* Date: 12/23/15
* Time: 6:16 PM
*/
use qfq\exceptions\UserException;
use qfq\exceptions\CodeException;
require_once(__DIR__ . '/../exceptions/UserException.php');
require_once(__DIR__ . '/../exceptions/CodeException.php');
//TODO: unit tests fuer alle abgefangenen Exceptions
/*
*
* @param string $bodytext keyvalue pairs.
*
* @return $string LOAD: the form as HTML, SAVE: success or failure message, or JS redirect to destination page.
*/
function renderForm($bodytext = "") {
try {
$form = new \qfq\Form();
} catch (UserException $e) {
echo $e->formatMessage();
} catch (CodeException $e) {
echo $e->formatMessage();
} catch (Exception $e) {
echo "Generic Exception: " . $e->getMessage();
}