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


PHP Form::getSubForms方法代码示例

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


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

示例1: recurseForm

 /**
  * Recurse the given form and return the descriptions for it and all of its subforms
  *
  * @param   Form    $form   The form to recurse
  *
  * @return  array
  */
 protected function recurseForm(Form $form)
 {
     $descriptions = array($form->getDescriptions());
     foreach ($form->getSubForms() as $subForm) {
         $descriptions[] = $this->recurseForm($subForm);
     }
     return call_user_func_array('array_merge', $descriptions);
 }
开发者ID:JakobGM,项目名称:icingaweb2,代码行数:15,代码来源:FormDescriptions.php

示例2: recurseForm

 /**
  * Recurse the given form and return the notifications for it and all of its subforms
  *
  * @param   Form    $form       The form to recurse
  *
  * @return array
  */
 protected function recurseForm(Form $form)
 {
     $notifications = $form->getNotifications();
     foreach ($form->getSubForms() as $subForm) {
         $notifications = $notifications + $this->recurseForm($subForm);
     }
     return $notifications;
 }
开发者ID:xert,项目名称:icingaweb2,代码行数:15,代码来源:FormNotifications.php

示例3: recurseForm

 /**
  * Recurse the given form and return the notifications for it and all of its subforms
  *
  * @param   Form    $form   The form to recurse
  *
  * @return  array
  */
 protected function recurseForm(Form $form)
 {
     $notifications = $form->getNotifications();
     foreach ($form->getSubForms() as $subForm) {
         foreach ($this->recurseForm($subForm) as $type => $messages) {
             foreach ($messages as $message) {
                 $notifications[$type][] = $message;
             }
         }
     }
     return $notifications;
 }
开发者ID:JakobGM,项目名称:icingaweb2,代码行数:19,代码来源:FormNotifications.php

示例4: recurseForm

 /**
  * Recurse the given form and return the descriptions for it and all of its subforms
  *
  * @param   Form    $form               The form to recurse
  * @param   mixed   $entirelyRequired   Set by reference, true means all elements in the hierarchy are
  *                                       required, false only a partial subset and null none at all
  * @param   bool    $elementsPassed     Whether there were any elements passed during the recursion until now
  *
  * @return  array
  */
 protected function recurseForm(Form $form, &$entirelyRequired = null, $elementsPassed = false)
 {
     $requiredLabels = array();
     if ($form->getRequiredCue() !== null) {
         $partiallyRequired = $partiallyOptional = false;
         foreach ($form->getElements() as $element) {
             if (!in_array($element->getType(), $this->blacklist)) {
                 if (!$element->isRequired()) {
                     $partiallyOptional = true;
                     if ($entirelyRequired) {
                         $entirelyRequired = false;
                     }
                 } else {
                     $partiallyRequired = true;
                     if (($label = $element->getDecorator('label')) !== false) {
                         $requiredLabels[] = $label;
                     }
                 }
             }
         }
         if (!$elementsPassed) {
             $elementsPassed = $partiallyRequired || $partiallyOptional;
             if ($entirelyRequired === null && $partiallyRequired) {
                 $entirelyRequired = !$partiallyOptional;
             }
         } elseif ($entirelyRequired === null && $partiallyRequired) {
             $entirelyRequired = false;
         }
     }
     $descriptions = array($form->getDescriptions());
     foreach ($form->getSubForms() as $subForm) {
         $descriptions[] = $this->recurseForm($subForm, $entirelyRequired, $elementsPassed);
     }
     if ($entirelyRequired) {
         foreach ($requiredLabels as $label) {
             $label->setRequiredSuffix('');
         }
     }
     return call_user_func_array('array_merge', $descriptions);
 }
开发者ID:hsanjuan,项目名称:icingaweb2,代码行数:50,代码来源:FormDescriptions.php


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