View sourcecode

The following files exists in this folder. Click to view.

phpdoc-cache-file_e4b4f7fd24d6adb0aaded671879d8ffa.dat

1 lines ASCII Unix (LF)
1
O:39:"phpDocumentor\Descriptor\FileDescriptor":22:{s:7:"*hash";s:32:"dea373b2b77e41edf155bac0d873cfbf";s:7:"*path";s:25:"HTMLForm/CFormExample.php";s:9:"*source";s:2958:"<?php

namespace Anax\HTMLForm;

/**
 * Anax base class for wrapping sessions.
 *
 */
class CFormExample extends \Mos\HTMLForm\CForm
{
    use \Anax\DI\TInjectionaware,
        \Anax\MVC\TRedirectHelpers;



    /**
     * Constructor
     *
     */
    public function __construct()
    {
        parent::__construct([], [
            'name' => [
                'type'        => 'text',
                'label'       => 'Name of contact person:',
                'required'    => true,
                'validation'  => ['not_empty'],
            ],
            'email' => [
                'type'        => 'text',
                'required'    => true,
                'validation'  => ['not_empty', 'email_adress'],
            ],
            'phone' => [
                'type'        => 'text',
                'required'    => true,
                'validation'  => ['not_empty', 'numeric'],
            ],
            'submit' => [
                'type'      => 'submit',
                'callback'  => [$this, 'callbackSubmit'],
            ],
            'submit-fail' => [
                'type'      => 'submit',
                'callback'  => [$this, 'callbackSubmitFail'],
            ],
        ]);
    }



    /**
     * Customise the check() method.
     *
     * @param callable $callIfSuccess handler to call if function returns true.
     * @param callable $callIfFail    handler to call if function returns true.
     */
    public function check($callIfSuccess = null, $callIfFail = null)
    {
        return parent::check([$this, 'callbackSuccess'], [$this, 'callbackFail']);
    }



    /**
     * Callback for submit-button.
     *
     */
    public function callbackSubmit()
    {
        $this->AddOutput("<p><i>DoSubmit(): Form was submitted. Do stuff (save to database) and return true (success) or false (failed processing form)</i></p>");
        $this->AddOutput("<p><b>Name: " . $this->Value('name') . "</b></p>");
        $this->AddOutput("<p><b>Email: " . $this->Value('email') . "</b></p>");
        $this->AddOutput("<p><b>Phone: " . $this->Value('phone') . "</b></p>");
        $this->saveInSession = true;
        return true;
    }



    /**
     * Callback for submit-button.
     *
     */
    public function callbackSubmitFail()
    {
        $this->AddOutput("<p><i>DoSubmitFail(): Form was submitted but I failed to process/save/validate it</i></p>");
        return false;
    }



    /**
     * Callback What to do if the form was submitted?
     *
     */
    public function callbackSuccess()
    {
        $this->AddOUtput("<p><i>Form was submitted and the callback method returned true.</i></p>");
        $this->redirectTo();
    }



    /**
     * Callback What to do when form could not be processed?
     *
     */
    public function callbackFail()
    {
        $this->AddOutput("<p><i>Form was submitted and the Check() method returned false.</i></p>");
        $this->redirectTo();
    }
}
";s:19:"*namespaceAliases";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:11:"*includes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*functions";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*classes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:27:"\Anax\HTMLForm\CFormExample";O:40:"phpDocumentor\Descriptor\ClassDescriptor":19:{s:9:"*parent";s:19:"\Mos\HTMLForm\CForm";s:13:"*implements";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:11:"*abstract";b:0;s:8:"*final";b:0;s:12:"*constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:13:"*properties";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*methods";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:6:{s:11:"__construct";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:15;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*fqsen";s:42:"\Anax\HTMLForm\CFormExample::__construct()";s:7:"*name";s:11:"__construct";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:11:"Constructor";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:20;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:5:"check";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:15;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:14:"$callIfSuccess";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":15:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:"*name";s:8:"callable";}}}s:10:"*default";s:4:"null";s:14:"*byReference";b:0;s:13:"*isVariadic";b:0;s:8:"*fqsen";s:0:"";s:7:"*name";s:14:"$callIfSuccess";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:0:"";s:14:"*description";s:41:"handler to call if function returns true.";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:11:"$callIfFail";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":15:{s:8:"*types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:"*name";s:8:"callable";}}}s:10:"*default";s:4:"null";s:14:"*byReference";b:0;s:13:"*isVariadic";b:0;s:8:"*fqsen";s:0:"";s:7:"*name";s:11:"$callIfFail";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:0:"";s:14:"*description";s:41:"handler to call if function returns true.";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:8:"*fqsen";s:36:"\Anax\HTMLForm\CFormExample::check()";s:7:"*name";s:5:"check";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:29:"Customise the check() method.";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:58;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{i:0;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:15:"*variableName";s:14:"$callIfSuccess";s:8:"*types";r:61;s:7:"*name";s:5:"param";s:14:"*description";s:41:"handler to call if function returns true.";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}i:1;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:15:"*variableName";s:11:"$callIfFail";s:8:"*types";r:82;s:7:"*name";s:5:"param";s:14:"*description";s:41:"handler to call if function returns true.";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:14:"callbackSubmit";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:15;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*fqsen";s:45:"\Anax\HTMLForm\CFormExample::callbackSubmit()";s:7:"*name";s:14:"callbackSubmit";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:27:"Callback for submit-button.";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:69;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:18:"callbackSubmitFail";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:15;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*fqsen";s:49:"\Anax\HTMLForm\CFormExample::callbackSubmitFail()";s:7:"*name";s:18:"callbackSubmitFail";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:27:"Callback for submit-button.";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:85;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:15:"callbackSuccess";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:15;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*fqsen";s:46:"\Anax\HTMLForm\CFormExample::callbackSuccess()";s:7:"*name";s:15:"callbackSuccess";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:46:"Callback What to do if the form was submitted?";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:97;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}s:12:"callbackFail";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:"*parent";r:15;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*fqsen";s:43:"\Anax\HTMLForm\CFormExample::callbackFail()";s:7:"*name";s:12:"callbackFail";s:12:"*namespace";N;s:10:"*package";s:0:"";s:10:"*summary";s:53:"Callback What to do when form could not be processed?";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:109;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:13:"*usedTraits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{i:0;s:24:"\Anax\DI\TInjectionaware";i:1;s:26:"\Anax\MVC\TRedirectHelpers";}}s:8:"*fqsen";s:27:"\Anax\HTMLForm\CFormExample";s:7:"*name";s:12:"CFormExample";s:12:"*namespace";s:14:"\Anax\HTMLForm";s:10:"*package";s:0:"";s:10:"*summary";s:38:"Anax base class for wrapping sessions.";s:14:"*description";s:0:"";s:17:"*fileDescriptor";r:1;s:7:"*line";i:9;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:7:"package";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"package";s:14:"*description";s:7:"Default";s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:10:"subpackage";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;}}}s:13:"*interfaces";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*traits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*markers";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*fqsen";s:0:"";s:7:"*name";s:16:"CFormExample.php";s:12:"*namespace";N;s:10:"*package";s:7:"Default";s:10:"*summary";s:0:"";s:14:"*description";s:0:"";s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:2:{s:7:"package";r:247;s:10:"subpackage";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:"*severity";s:5:"error";s:7:"*code";s:13:"PPC:ERR-50000";s:7:"*line";i:0;s:10:"*context";a:2:{s:11:"{{ value }}";s:2:"""";i:0;s:0:"";}}}}s:19:"*inheritedElement";N;}