/** * (non-PHPdoc) * @see \tfc\mvc\form\FormBuilder::_init() */ protected function _init() { // 初始化表单Action if (isset($this->_tplVars['action'])) { $this->action = $this->_tplVars['action']; unset($this->_tplVars['action']); } // 初始化表单元素管理类 $this->initElementsObject(); parent::_init(); }
/** * (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::_init() */ protected function _init() { // 初始化表单Action if (isset($this->_tplVars['action'])) { $this->action = $this->_tplVars['action']; unset($this->_tplVars['action']); } // 初始化表单元素管理类 $this->initElementsObject(); // 初始化分类标签 $this->_tabs['main']['prompt'] = Text::_('CFG_SYSTEM_GLOBAL_VIEWTAB_MAIN_PROMPT'); $this->setTabs($this->elements_object->getViewTabsRender()); parent::_init(); }