当前位置: 首页>>代码示例>>PHP>>正文


PHP Fieldset::prepareElement方法代码示例

本文整理汇总了PHP中Zend\Form\Fieldset::prepareElement方法的典型用法代码示例。如果您正苦于以下问题:PHP Fieldset::prepareElement方法的具体用法?PHP Fieldset::prepareElement怎么用?PHP Fieldset::prepareElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Form\Fieldset的用法示例。


在下文中一共展示了Fieldset::prepareElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: prepareElement

 /**
  * Prepare the collection by adding a dummy template element if the user want one
  *
  * @param  FormInterface $form
  * @return mixed|void
  */
 public function prepareElement(FormInterface $form)
 {
     if (true === $this->shouldCreateChildrenOnPrepareElement) {
         if ($this->targetElement !== null && $this->count > 0) {
             while ($this->count > $this->lastChildIndex + 1) {
                 $this->addNewTargetElementInstance(++$this->lastChildIndex);
             }
         }
     }
     // Create a template that will also be prepared
     if ($this->shouldCreateTemplate) {
         $templateElement = $this->getTemplateElement();
         $this->add($templateElement);
     }
     parent::prepareElement($form);
     // The template element has been prepared, but we don't want it to be rendered nor validated, so remove it from the list
     if ($this->shouldCreateTemplate) {
         $this->remove($this->templatePlaceholder);
     }
 }
开发者ID:ErR163,项目名称:torrentpier,代码行数:26,代码来源:Collection.php

示例2: prepareElement

 /**
  * Prepare the collection by adding a dummy template element if the user want one
  *
  * @param  FormInterface $form
  * @return mixed|void
  */
 public function prepareElement(FormInterface $form)
 {
     // Create a template that will also be prepared
     if ($this->shouldCreateTemplate) {
         $templateElement = $this->getTemplateElement();
         $this->add($templateElement);
     }
     parent::prepareElement($form);
     // The template element has been prepared, but we don't want it to be rendered nor validated, so remove it from the list
     if ($this->shouldCreateTemplate) {
         $this->remove($this->templatePlaceholder);
     }
 }
开发者ID:leonardovn86,项目名称:zf2_basic2013,代码行数:19,代码来源:Collection.php

示例3: prepareElement

 /**
  * Prepare the collection by adding a dummy template element if the user want one
  *
  * @param  FormInterface $form
  * @return mixed|void
  */
 public function prepareElement(FormInterface $form)
 {
     if (true === $this->shouldCreateChildrenOnPrepareElement) {
         if ($this->targetElement !== null && $this->count > 0) {
             $applyNames = count($this->keyNames) > 0 && count($this->keyNames) === $this->count ? 1 : 0;
             while ($this->count > $this->lastChildIndex + 1) {
                 $label = isset($this->labels[$this->lastChildIndex + 1]) ? $this->labels[$this->lastChildIndex + 1] : null;
                 $this->addNewTargetElementInstance($applyNames ? $this->keyNames[++$this->lastChildIndex] : ++$this->lastChildIndex, $label);
             }
         }
     }
     // Create a template that will also be prepared
     if ($this->shouldCreateTemplate) {
         $templateElement = $this->getTemplateElement();
         $this->add($templateElement);
     }
     parent::prepareElement($form);
     // The template element has been prepared, but we don't want it to be
     // rendered nor validated, so remove it from the list.
     if ($this->shouldCreateTemplate) {
         $this->remove($this->templatePlaceholder);
     }
 }
开发者ID:serus22,项目名称:zend-form,代码行数:29,代码来源:Collection.php


注:本文中的Zend\Form\Fieldset::prepareElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。