當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kwc_Abstract_Form::createComponentForm方法代碼示例

本文整理匯總了PHP中Kwc_Abstract_Form::createComponentForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kwc_Abstract_Form::createComponentForm方法的具體用法?PHP Kwc_Abstract_Form::createComponentForm怎麽用?PHP Kwc_Abstract_Form::createComponentForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Kwc_Abstract_Form的用法示例。


在下文中一共展示了Kwc_Abstract_Form::createComponentForm方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCardForms

 public function getCardForms()
 {
     $ret = array();
     $title = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($this->_class, 'componentName'));
     $title = str_replace('.', ' ', $title);
     $ret['form'] = array('form' => Kwc_Abstract_Form::createComponentForm($this->_class, 'child'), 'title' => $title);
     return $ret;
 }
開發者ID:koala-framework,項目名稱:koala-framework,代碼行數:8,代碼來源:Admin.php

示例2: getCardForms

 public function getCardForms()
 {
     $ret = array();
     $news = Kwf_Component_Data_Root::getInstance()->getComponentsByClass('Kwc_Events_Directory_Component');
     foreach ($news as $new) {
         $form = Kwc_Abstract_Form::createComponentForm($this->_class, 'child');
         $form->fields['event_id']->setBaseParams(array('eventsComponentId' => $new->dbId));
         $form->fields['event_id']->setFieldLabel($new->getPage()->name);
         $ret[$new->dbId] = array('form' => $form, 'title' => $new->getTitle());
     }
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:12,代碼來源:Admin.php

示例3: getCardForms

 public function getCardForms()
 {
     $ret = array();
     $blogs = Kwf_Component_Data_Root::getInstance()->getComponentsByClass('Kwc_Blog_Directory_Component', array('ignoreVisible' => true));
     foreach ($blogs as $blog) {
         $form = Kwc_Abstract_Form::createComponentForm($this->_class, 'child');
         $form->fields['blog_post_id']->setBaseParams(array('blogComponentId' => $blog->dbId));
         $form->fields['blog_post_id']->setFieldLabel($blog->getPage()->name);
         $form->fields['blog_post_id']->setData(new Kwc_Basic_LinkTag_BlogPost_BlogPostIdData());
         $ret[$blog->dbId] = array('form' => $form, 'title' => count($blogs) > 1 ? $blog->getTitle() : trlKwf('Blog'));
     }
     return $ret;
 }
開發者ID:koala-framework,項目名稱:koala-framework,代碼行數:13,代碼來源:Admin.php

示例4: preDispatch

 public function preDispatch()
 {
     $t = microtime(true);
     if (!isset($this->_form)) {
         if (isset($this->_formName)) {
             $this->_form = new $this->_formName(null, $this->_getParam('class'));
         } else {
             $this->_form = Kwc_Abstract_Form::createComponentForm($this->_getParam('class'), 'component');
         }
     }
     Kwf_Benchmark::subCheckpoint('create component form', microtime(true) - $t);
     $this->_form->setBodyStyle('padding: 10px');
     $this->_form->setId($this->_getParam('componentId'));
     parent::preDispatch();
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:15,代碼來源:Form.php

示例5: _createChildComponentForm

 protected function _createChildComponentForm($id, $name = null)
 {
     if (substr($id, 0, 1) != '-' && substr($id, 0, 1) != '_') {
         throw new Kwf_Exception("'-' or '_' is missing in id");
     }
     if (!$name) {
         $name = substr($id, 1);
     }
     $idTemplate = '{0}' . $id;
     $childComponentClass = null;
     $detailClass = $this->getClass();
     foreach (Kwc_Abstract::getSetting($detailClass, 'generators') as $generatorKey => $generatorData) {
         $generator = Kwf_Component_Generator_Abstract::getInstance($detailClass, $generatorKey);
         if ($generator->getIdSeparator() != substr($id, 0, 1)) {
             continue;
         }
         $childComponentClass = $generator->getComponentByKey(substr($id, 1));
         if ($childComponentClass) {
             break;
         }
     }
     if (!$childComponentClass) {
         throw new Kwf_Exception("No child component with id '{$id}' for '{$detailClass}' found.");
     }
     $form = Kwc_Abstract_Form::createComponentForm($childComponentClass, $name);
     if (!$form) {
         return null;
     }
     $detailGen = Kwf_Component_Generator_Abstract::getInstance($this->getDirectoryClass(), 'detail');
     if ($detailGen->hasSetting('dbIdShortcut')) {
         $dbIdShortcut = $detailGen->getSetting('dbIdShortcut');
         $form->setIdTemplate($dbIdShortcut . $idTemplate);
     } else {
         if (!$detailGen->getModel()->hasColumn('component_id')) {
             throw new Kwf_Exception("Model '" . get_class($detailGen->getModel()) . "' doesn't have component_id column");
         }
         $form->setIdTemplate('{component_id}' . $detailGen->getIdSeparator() . $idTemplate);
     }
     return $form;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:40,代碼來源:Form.php


注:本文中的Kwc_Abstract_Form::createComponentForm方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。