当前位置: 首页>>代码示例>>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;未经允许,请勿转载。