/** * * @return $this * */ public function add_cancel_button($text = null, array $attrs = array(), $class = '') { $button = new HTMLLongTag('button', $text ? $text : \ZPHP\String::get_html('cancel')); $button->update_params($attrs); $button->set_param('type', 'button'); $button->add_class($class); $button->add_class(self::$_DEFAULT_BUTTON_CLASS); $button->add_class(self::$_DEFAULT_BUTTON_CANCEL_CLASS); $this->_buttons[] = $button; if (!$button->get_id()) { $button->set_random_id(); } $this->_cancel_buttons[] = $button->get_id(); return $this; }