當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormView::offsetGet方法代碼示例

本文整理匯總了PHP中Symfony\Component\Form\FormView::offsetGet方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormView::offsetGet方法的具體用法?PHP FormView::offsetGet怎麽用?PHP FormView::offsetGet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Form\FormView的用法示例。


在下文中一共展示了FormView::offsetGet方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 function it_changes_label_attribute_for(FormInterface $form, FormView $view, FormView $fileView)
 {
     $form->getName()->willReturn('file');
     $view->offsetGet('file')->willReturn($fileView);
     $view->vars = array('label_attr' => array());
     $fileView->vars = array('id' => 'form_file_file');
     $this->finishView($view, $form, array());
     expect($view->vars['label_attr']['for'])->toBe('form_file_file');
 }
開發者ID:norzechowicz,項目名稱:doctrine-extensions-bundle,代碼行數:9,代碼來源:RemovableFileTypeSpec.php

示例2: finishView

 public function finishView(FormView $view, FormInterface $form, array $options)
 {
     /** @var FormView[] $fields */
     if ($view->offsetExists('submit_group')) {
         $fields = array($view->offsetGet('submit_group'));
         $view->offsetUnset('submit_group');
         $view->children = $view->children + $fields;
     }
     parent::finishView($view, $form, $options);
 }
開發者ID:xavier-dubreuil,項目名稱:LightCMS,代碼行數:10,代碼來源:NodeType.php

示例3: finishView

 /**
  * {@inheritdoc}
  */
 public function finishView(FormView $view, FormInterface $form, array $options)
 {
     $isManualEditGranted = $this->orderAddressSecurityProvider->isManualEditGranted($options['addressType']);
     foreach ($view->children as $child) {
         $child->vars['disabled'] = !$isManualEditGranted;
         $child->vars['required'] = false;
         unset($child->vars['attr']['data-validation'], $child->vars['attr']['data-required'], $child->vars['label_attr']['data-required']);
     }
     if ($view->offsetExists('accountAddress')) {
         $view->offsetGet('accountAddress')->vars['disabled'] = false;
     }
 }
開發者ID:adam-paterson,項目名稱:orocommerce,代碼行數:15,代碼來源:OrderAddressType.php

示例4: renderFormElement

 /**
  * render a field element from the FieldDescription
  *
  *
  * @throws InvalidArgumentException
  * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
  * @param \Sumfony\Component\Form\FormView $formView
  * @param mixed $object
  * @param array $params
  * @return string
  */
 public function renderFormElement(FieldDescriptionInterface $fieldDescription, FormView $formView, $object, $params = array())
 {
     if (!$fieldDescription->getFieldName()) {
         return '';
     }
     if (!$formView->offsetExists($fieldDescription->getFieldName())) {
         throw new \RuntimeException(sprintf('No child named %s', $fieldDescription->getFieldName()));
     }
     $children = $formView->offsetGet($fieldDescription->getFieldName());
     if (in_array('hidden', $children->get('types'))) {
         return '';
     }
     // find the correct edit parameter
     //  edit   : standard | inline
     //  inline : natural | table
     $parentFieldDescription = $fieldDescription->getAdmin()->getParentFieldDescription();
     if (!$parentFieldDescription) {
         $params['edit'] = $fieldDescription->getOption('edit', 'standard');
         $params['inline'] = $fieldDescription->getOption('inline', 'natural');
         $base_template = sprintf('SonataAdminBundle:CRUD:base_%s_edit_field.html.twig', 'standard');
     } else {
         $params['edit'] = $parentFieldDescription->getOption('edit', 'standard');
         $params['inline'] = $parentFieldDescription->getOption('inline', 'natural');
         $base_template = sprintf('SonataAdminBundle:CRUD:base_%s_edit_field.html.twig', $params['edit']);
     }
     $template = $this->environment->loadTemplate($fieldDescription->getTemplate());
     return $this->output($fieldDescription, $template->render(array_merge($params, array('admin' => $fieldDescription->getAdmin(), 'object' => $object, 'field_description' => $fieldDescription, 'value' => $this->getValueFromFieldDescription($object, $fieldDescription, $params), 'field_element' => $children, 'base_template' => $fieldDescription->getOption('base_template', $base_template)))));
 }
開發者ID:renegare,項目名稱:AdminBundle,代碼行數:39,代碼來源:SonataAdminExtension.php


注:本文中的Symfony\Component\Form\FormView::offsetGet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。