protected function deleteForm($action) { static $form; if (!$form) { $form = new Form(); } $form->setAction($action)->setSubmit('Delete'); $token = $this->session->generateCsrf(); return $form->render(); }
function __construct($id, $name) { parent::__construct(); $this->setAction('?category/save/' . $id)->add('name', $name, '[a-zA-Z]+', 'Name must contains only letters.'); }