Frontend\Core\Engine\Form::parse PHP Method

parse() public method

Parse the form
public parse ( TwigTemplate $tpl )
$tpl TwigTemplate The template instance wherein the form will be parsed.
    public function parse($tpl)
    {
        // parse the form
        parent::parse($tpl);
        // validate the form
        $this->validate();
        // if the form is submitted but there was an error, assign a general error
        if ($this->isSubmitted() && !$this->isCorrect()) {
            $tpl->assign('formError', true);
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Parse the data into the template
  */
 private function parse()
 {
     // have the settings been saved?
     if ($this->URL->getParameter('sent') == 'true') {
         // show success message
         $this->tpl->assign('updatePasswordSuccess', true);
     }
     // parse the form
     $this->frm->parse($this->tpl);
 }
All Usage Examples Of Frontend\Core\Engine\Form::parse