Nette\Bridges\FormsLatte\Runtime::renderFormBegin PHP Метод

renderFormBegin() публичный статический Метод

Renders form begin.
public static renderFormBegin ( Form $form, array $attrs, $withTags = TRUE ) : string
$form Nette\Forms\Form
$attrs array
Результат string
    public static function renderFormBegin(Form $form, array $attrs, $withTags = TRUE)
    {
        $form->fireRenderEvents();
        foreach ($form->getControls() as $control) {
            $control->setOption('rendered', FALSE);
        }
        $el = $form->getElementPrototype();
        $el->action = (string) $el->action;
        $el = clone $el;
        if ($form->isMethod('get')) {
            $el->action = preg_replace('~\\?[^#]*~', '', $el->action, 1);
        }
        $el->addAttributes($attrs);
        return $withTags ? $el->startTag() : $el->attributes();
    }

Usage Example

Пример #1
0
 /**
  * Renders form begin.
  * @param Form $form
  * @param array $attrs
  * @param bool $withTags
  * @return string
  */
 public static function renderFormBegin(Form $form, array $attrs, $withTags = TRUE)
 {
     $renderer = $form->getRenderer();
     if ($renderer instanceof IManualRenderer) {
         $renderer->beforeRender($form);
     }
     return parent::renderFormBegin($form, $attrs, $withTags);
 }
All Usage Examples Of Nette\Bridges\FormsLatte\Runtime::renderFormBegin