public function __construct($name, $method = self::METHOD_POST, $action = null, $enctype = self::ENCTYPE_APPLICATION_URLENCODED) { parent::__construct('form'); $this->closingType = self::CLOSE_TYPE_NONE; $this->name($name); $this->enctype($enctype); $this->method($method); $this->action($action === null ? url() : $action); // Add csrf token if (strtolower($method) !== 'get') { $this->addItem(new HtmlInput(BaseCsrfVerifier::POST_KEY, 'hidden', csrf_token())); } }