private function addCsrf()
    {
        if (!$this->getName()) {
            throw new \LogicException("Can't set CSRF token with form name");
        }

        $csrfName = 'CSRF_' . $this->getName();
        $csrfToken = md5((string) mt_rand());
        self::session()->set($csrfName, $csrfToken);
        $this->addFirst(new Hidden('_csrf', $csrfToken));
    }