src/Form/Form.php
protected function addCsrfElement()
    {
        if ($this->has('csrf')) {
            return;
        }

        $spec = array_replace_recursive($this->csrfElementSpec, [
                'name' => $this->getCsrfElementName(),
                'options' => [
                    'csrf_options' => [
                        'timeout' => $this->getFormTimeout(),
                    ],
                ],
            ]);

        $this->add($spec, ['priority' => -980]);
    }
protected function addCsrfElement()
    {
        if ($this->has('csrf')) {
            return;
        }

        $spec = array_replace_recursive($this->csrfElementSpec, [
                'name' => $this->getCsrfElementName(),
                'options' => [
                    'csrf_options' => [
                        'timeout' => $this->getFormTimeout(),
                    ],
                ],
            ]);

        $this->add($spec, ['priority' => -980]);
    }
protected function addCsrfElement ( ) { if ( $ this -> has ( 'csrf' ) ) { return ; } $ spec = array_replace_recursive ( $ this -> csrfElementSpec , [ 'name' => $ this -> getCsrfElementName ( ) , 'options' => [ 'csrf_options' => [ 'timeout' => $ this -> getFormTimeout ( ) , ] , ] , ] ) ; $ this -> add ( $ spec , [ 'priority' => - 980 ] ) ; }
Setup CSRF protection
Setup CSRF protection