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]);
    }