/** * (non-PHPdoc) * @see \tfc\mvc\form\FormBuilder::_init() */ protected function _init() { $this->html_type = isset($this->html_type) ? trim($this->html_type) : ''; $this->post_id = isset($this->post_id) ? (int) $this->post_id : 0; if ($this->html_type === self::HTML_TYPE_FORM) { $this->action = $this->getView()->getUrlManager()->getUrl('commentcreate', 'data', 'posts'); $this->_tplVars['elements'] = array('author_name' => array('__object__' => 'tfc\\mvc\\form\\InputElement', 'type' => 'text', 'label' => Text::_('MOD_POSTS_POST_COMMENTS_AUTHOR_NAME_LABEL'), 'required' => true, 'class' => $this->className), 'author_mail' => array('__object__' => 'tfc\\mvc\\form\\InputElement', 'type' => 'email', 'label' => Text::_('MOD_POSTS_POST_COMMENTS_AUTHOR_MAIL_LABEL'), 'required' => true, 'class' => $this->className), 'content' => array('__object__' => 'tfc\\mvc\\form\\InputElement', 'type' => 'textarea', 'label' => Text::_('MOD_POSTS_POST_COMMENTS_CONTENT_LABEL'), 'required' => true, 'class' => $this->className, 'rows' => 10), 'post_id' => array('__object__' => 'tfc\\mvc\\form\\InputElement', 'type' => 'hidden', 'value' => $this->post_id), 'comment_pid' => array('__object__' => 'tfc\\mvc\\form\\InputElement', 'type' => 'hidden', 'value' => 0), '_button_save_' => array('__object__' => 'tfc\\mvc\\form\\ButtonElement', 'type' => 'button', 'value' => Text::_('CFG_SYSTEM_GLOBAL_SUBMIT'), 'class' => 'btn btn-default')); } else { $this->_tplVars['elements'] = array(); } parent::_init(); }
/** * (non-PHPdoc) * @see \tfc\mvc\form\FormBuilder::run() */ public function run() { parent::run(); $this->displayJs(); }
/** * (non-PHPdoc) * @see \tfc\mvc\form\FormBuilder::createElement() */ public function createElement($className, array $config = array()) { if (strpos($className, '\\') === false) { $className = 'views\\bootstrap\\components\\form\\' . $className; } return parent::createElement($className, $config); }