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


PHP Zend_Form::getElementsBelongTo方法代碼示例

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


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

示例1: _recursivelyPrepareForm

 protected function _recursivelyPrepareForm(Zend_Form $form)
 {
     $belongsTo = $form instanceof Zend_Form ? $form->getElementsBelongTo() : null;
     $elementContent = '';
     $separator = $this->getSeparator();
     $translator = $form->getTranslator();
     $view = $form->getView();
     foreach ($form as $item) {
         $item->setView($view)->setTranslator($translator);
         if ($item instanceof Zend_Form_Element) {
             $item->setBelongsTo($belongsTo);
         } elseif (!empty($belongsTo) && $item instanceof Zend_Form) {
             if ($item->isArray()) {
                 $name = $this->mergeBelongsTo($belongsTo, $item->getElementsBelongTo());
                 $item->setElementsBelongTo($name, true);
             } else {
                 $item->setElementsBelongTo($belongsTo, true);
             }
             $this->_recursivelyPrepareForm($item);
         } elseif (!empty($belongsTo) && $item instanceof Zend_Form_DisplayGroup) {
             foreach ($item as $element) {
                 $element->setBelongsTo($belongsTo);
             }
         }
     }
 }
開發者ID:NerdGZ,項目名稱:icingaweb2,代碼行數:26,代碼來源:PrepareElements.php

示例2: __construct

 public function __construct(Zend_Form $form)
 {
     parent::__construct();
     $this->view = Zend_Layout::getMvcInstance()->getView();
     $this->formName = $form->getName();
     $elementsBelongTo = $form->getElementsBelongTo();
     $this->elementPrefix = '';
     if ($elementsBelongTo) {
         $this->elementPrefix = Zmz_Utils::stripFormArrayNotation($elementsBelongTo);
         $this->elementPrefix .= '-';
     }
     $this->init();
 }
開發者ID:massimozappino,項目名稱:zmz,代碼行數:13,代碼來源:JsFormAbstract.php

示例3: addSubForm

 /**
  * Add a form group/subform
  *
  * @param  Zend_Form $form
  * @param  string $name
  * @param  int $order
  * @return Zend_Form
  */
 public function addSubForm(Zend_Form $form, $name, $order = null)
 {
     $name = (string) $name;
     /** @var Zend_Loader_PluginLoader $loader */
     foreach ($this->_loaders as $type => $loader) {
         $loaderPaths = $loader->getPaths();
         foreach ($loaderPaths as $prefix => $paths) {
             foreach ($paths as $path) {
                 $form->addPrefixPath($prefix, $path, $type);
             }
         }
     }
     if (!empty($this->_elementPrefixPaths)) {
         foreach ($this->_elementPrefixPaths as $spec) {
             list($prefix, $path, $type) = array_values($spec);
             $form->addElementPrefixPath($prefix, $path, $type);
         }
     }
     if (!empty($this->_displayGroupPrefixPaths)) {
         foreach ($this->_displayGroupPrefixPaths as $spec) {
             list($prefix, $path) = array_values($spec);
             $form->addDisplayGroupPrefixPath($prefix, $path);
         }
     }
     if (null !== $order) {
         $form->setOrder($order);
     }
     if (($oldName = $form->getName()) && $oldName !== $name && $oldName === $form->getElementsBelongTo()) {
         $form->setElementsBelongTo($name);
     }
     $form->setName($name);
     $this->_subForms[$name] = $form;
     $this->_order[$name] = $order;
     $this->_orderUpdated = true;
     return $this;
 }
開發者ID:bartolomeu,項目名稱:estoque_gusella,代碼行數:44,代碼來源:Form.php

示例4: testSettingArrayToWhichElementsBelongEmptyClearsIt

 public function testSettingArrayToWhichElementsBelongEmptyClearsIt()
 {
     $this->testCanSetArrayToWhichElementsBelong();
     $this->form->setElementsBelongTo('');
     $this->assertNull($this->form->getElementsBelongTo());
 }
開發者ID:vicfryzel,項目名稱:zf,代碼行數:6,代碼來源:FormTest.php


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