src/Yggdrasil/Utils/Templating/FormExtension.php
public function beginForm(string $name, string $action): void
    {
        $this->formOptions = $this->getFormOptions($name);

        $form = "<form id=\"{$name}\" action=\"{$action}\" method=\"post\"";

        $usePjax = (isset($this->formOptions['use_pjax'])) ?
            filter_var($this->formOptions['use_pjax'], FILTER_VALIDATE_BOOLEAN)
            : true;

        $pjaxAttr = ($usePjax) ? 'data-pjax' : '';

        foreach ($this->formOptions as $attr => $value) {
            if (in_array($attr, ['use_pjax', 'use_csrf', 'fields'])) {
                continue;
            }

            $form .= " {$attr}=\"{$value}\"";
        }

        echo "$form $pjaxAttr>";
    }
public function beginForm(string $name, string $action): void
    {
        $this->formOptions = $this->getFormOptions($name);

        $form = "<form id=\"{$name}\" action=\"{$action}\" method=\"post\"";

        $usePjax = (isset($this->formOptions['use_pjax'])) ?
            filter_var($this->formOptions['use_pjax'], FILTER_VALIDATE_BOOLEAN)
            : true;

        $pjaxAttr = ($usePjax) ? 'data-pjax' : '';

        foreach ($this->formOptions as $attr => $value) {
            if (in_array($attr, ['use_pjax', 'use_csrf', 'fields'])) {
                continue;
            }

            $form .= " {$attr}=\"{$value}\"";
        }

        echo "$form $pjaxAttr>";
    }
public function beginForm ( string $ name , string $ action ) : void { $ this -> formOptions = $ this -> getFormOptions ( $ name ) ; $ form = "<form id=\"{$name}\" action=\"{$action}\" method=\"post\"" ; $ usePjax = ( isset ( $ this -> formOptions [ 'use_pjax' ] ) ) ? filter_var ( $ this -> formOptions [ 'use_pjax' ] , FILTER_VALIDATE_BOOLEAN ) : true ; $ pjaxAttr = ( $ usePjax ) ? 'data-pjax' : '' ; foreach ( $ this -> formOptions as $ attr => $ value ) { if ( in_array ( $ attr , [ 'use_pjax' , 'use_csrf' , 'fields' ] ) ) { continue ; } $ form .= " {$attr}=\"{$value}\"" ; } echo "$form $pjaxAttr>" ; }
Begins HTML form

@param string $name    Form name, equivalent to ID attribute
@param string $action  Form action URL, equivalent to action attribute
Begins HTML form