Exemplo n.º 1
0
 function formatOutputData($result)
 {
     if (Result::is_result($result)) {
         if (Result::is_ok($result)) {
             $result = Redirect::success();
         } else {
             $result = Redirect::failure();
         }
     }
     if ($result instanceof IActionCommand) {
         return $result->execute();
     }
     echo render_result($result);
 }
Exemplo n.º 2
0
function validate($validator, $value, $param_description = null)
{
    $params = array();
    if (is_array($value)) {
        $params = $value;
    } else {
        $params[$validator] = $value;
    }
    if ($param_description !== null) {
        $params["nome_parametro"] = $param_description;
    }
    $result = call("validation", $validator, $params);
    Flash::updateFromResult($result);
    return Result::is_ok($result);
}