示例#1
0
 public function render(Form $form, $mode = NULL, $control = NULL)
 {
     \Tracy\Debugger::barDump(func_get_args());
     if ($this->form !== $form) {
         $this->form = $form;
     }
     if ($mode === 'pair') {
         if (is_string($control)) {
             $control = $form[$control];
         }
         return $this->renderPair($control);
     } elseif ($mode === 'container') {
         return $this->renderControls($control);
     } elseif ($mode === 'errors') {
         return $this->renderAllErrors($form);
     } else {
         $errors = '';
         if ($mode === NULL) {
             $errors = $this->renderAllErrors($form);
             $form->cleanErrors();
         }
         return $errors . parent::render($form, $mode);
     }
 }