當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。