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


PHP FormView::getChildren方法代码示例

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


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

示例1: buildViewBottomUp

 public function buildViewBottomUp(FormView $view, FormInterface $form)
 {
     foreach ($view->getChildren() as $child) {
         /* @var \Symfony\Component\Form\FormView $child */
         $child->set('full_name', $child->get('name'));
     }
 }
开发者ID:hatimeria,项目名称:HatimeriaDotpayBundle,代码行数:7,代码来源:RequestFormType.php

示例2: buildViewBottomUp

 public function buildViewBottomUp(FormView $view, FormInterface $form)
 {
     $multipart = false;
     foreach ($view->getChildren() as $child) {
         if ($child->get('multipart')) {
             $multipart = true;
             break;
         }
     }
     $view->set('multipart', $multipart);
 }
开发者ID:rfc1483,项目名称:doctrine,代码行数:11,代码来源:FormType.php

示例3: buildViewBottomUp

 /**
  * {@inheritdoc}
  */
 public function buildViewBottomUp(FormView $view, FormInterface $form)
 {
     if ($view->get('expanded')) {
         // Radio buttons should have the same name as the parent
         $childName = $view->get('full_name');
         // Checkboxes should append "[]" to allow multiple selection
         if ($view->get('multiple')) {
             $childName .= '[]';
         }
         foreach ($view->getChildren() as $childView) {
             $childView->set('full_name', $childName);
         }
     }
 }
开发者ID:rouffj,项目名称:symfony,代码行数:17,代码来源:ChoiceType.php

示例4: collectErrors

 private function collectErrors(FormView $form, &$errors)
 {
     if ($form->get('errors')) {
         $errors[] = $form;
     }
     foreach ($form->getChildren() as $child) {
         $this->collectErrors($child, $errors);
     }
 }
开发者ID:rtznprmpftl,项目名称:Zikulacore,代码行数:9,代码来源:FormRenderer.php

示例5: renderFormRest

 protected function renderFormRest(FormView $view, $blockName, array $variables = array())
 {
     $renderedView = array();
     // TODO, here add the rendered views to a form object, or something
     foreach ($view->getChildren() as $childView) {
         $renderedView[] = $this->renderBlock($childView, 'row');
     }
     return $renderedView;
 }
开发者ID:rpg600,项目名称:FSCRestBundle,代码行数:9,代码来源:FormNormalizer.php

示例6: hasFormDeepErrors

 /**
  * @param FormView $form A form.
  * @return boolean If the form (taking into account all of its children) has errors.
  */
 public function hasFormDeepErrors(FormView $form)
 {
     if (count($form->get('errors')) > 0) {
         return true;
     }
     foreach ($form->getChildren() as $child) {
         if ($this->hasFormDeepErrors($child)) {
             return true;
         }
     }
     return false;
 }
开发者ID:rrehbeindoi,项目名称:TwigExtensionsBundle,代码行数:16,代码来源:FormExtension.php


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