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


PHP Form::createView方法代码示例

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


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

示例1: renderList

 /**
  * @param $page
  * @param null $template
  *
  * @return \Symfony\Component\HttpFoundation\Response
  *
  * @throws \Exception
  */
 public function renderList($page, $template = null)
 {
     $user = $this->getUser();
     $tpl = null === $template ? $this->templatePath . 'list.html.twig' : $template;
     if ($this->filterForm) {
         $this->filterForm = $this->createForm($this->filterForm);
     }
     $qb = $this->buildFilterQuery();
     $paginator = $this->get('knp_paginator');
     $pagination = $paginator->paginate($qb->getQuery(), $page, $this->list_item_per_page, $this->defaultSortList);
     return $this->render($tpl, array('user' => $user, 'nbPerPage' => $this->list_item_per_page, 'page' => $page, 'form' => $this->filterForm ? $this->filterForm->createView() : null, 'baseRoute' => $this->baseRoute, 'entityName' => $this->entityName, 'list' => ['records' => $pagination, 'fields' => $this->listColumn, 'parameters' => $this->listConf, 'actions' => $this->listActions], 'actionsList' => $this->actionsList(), 'listTitle' => $this->listTitle));
 }
开发者ID:matthieuleorat,项目名称:admin-bundle,代码行数:20,代码来源:AdminController.php

示例2: editAction

 /**
  * Edit a group type
  *
  * @param GroupType $groupType
  *
  * @Template
  * @AclAncestor("pim_enrich_group_type_edit")
  * @return array
  */
 public function editAction(GroupType $groupType)
 {
     if ($this->groupTypeHandler->process($groupType)) {
         $this->addFlash('success', 'flash.group type.updated');
     }
     return array('form' => $this->groupTypeForm->createView());
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:16,代码来源:GroupTypeController.php

示例3: getViewFiltersForm

 /**
  * getViewFiltersForm
  * 
  * @return \Symfony\Component\Form\Form::createView or false
  */
 protected function getViewFiltersForm()
 {
     if ($this->filter_fields) {
         return $this->filter_form->createView();
     }
     return false;
 }
开发者ID:zk2,项目名称:admin-panel-bundle,代码行数:12,代码来源:AdminPanelController.php

示例4: getFormView

 /**
  * @return FormView
  */
 public function getFormView()
 {
     if (is_null($this->formView)) {
         $this->formView = $this->form->createView();
     }
     return $this->formView;
 }
开发者ID:headonkeyboard,项目名称:KunstmaanBundlesCMS,代码行数:10,代码来源:TabPane.php

示例5: editAction

 /**
  * Edit a family
  *
  * TODO : find a way to use param converter with interfaces
  *
  * @param Family $family
  *
  * @Template
  * @AclAncestor("pim_enrich_family_index")
  *
  * @return array
  */
 public function editAction(Family $family)
 {
     if ($this->familyHandler->process($family)) {
         $this->addFlash('success', 'flash.family.updated');
     }
     return ['form' => $this->familyForm->createView(), 'attributesForm' => $this->getAvailableAttributesForm($family->getAttributes()->toArray())->createView(), 'channels' => $this->channelManager->getChannels()];
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:19,代码来源:FamilyController.php

示例6: editAction

 /**
  * Edit a group
  *
  * TODO : find a way to use param converter with interfaces
  *
  * @param Group $group
  *
  * @Template
  * @AclAncestor("pim_enrich_group_edit")
  *
  * @return array
  */
 public function editAction(Group $group)
 {
     if ($this->groupHandler->process($group)) {
         $this->addFlash('success', 'flash.group.updated');
     }
     return ['form' => $this->groupForm->createView(), 'currentGroup' => $group->getId()];
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:19,代码来源:GroupController.php

示例7: editAction

 /**
  * Edit a group type
  *
  * @param GroupType $groupType
  *
  * @Template
  * @AclAncestor("pim_enrich_grouptype_edit")
  *
  * @return array
  */
 public function editAction(GroupType $groupType)
 {
     if ($this->groupTypeHandler->process($groupType)) {
         $this->request->getSession()->getFlashBag()->add('success', new Message('flash.group type.updated'));
     }
     return ['form' => $this->groupTypeForm->createView()];
 }
开发者ID:userz58,项目名称:pim-community-dev,代码行数:17,代码来源:GroupTypeController.php

示例8: assertViewIsValid

 protected function assertViewIsValid(Form $form, array $formData)
 {
     $view = $form->createView();
     $children = $view->children;
     foreach (array_keys($formData) as $key) {
         $this->assertArrayHasKey($key, $children);
     }
 }
开发者ID:claroline,项目名称:distribution,代码行数:8,代码来源:FormTestCase.php

示例9: editAction

 /**
  * Edit attribute form
  *
  * @param int $id
  *
  * @Template("PimEnrichBundle:Attribute:form.html.twig")
  * @AclAncestor("pim_enrich_attribute_edit")
  *
  * @return array
  */
 public function editAction(Request $request, $id)
 {
     $attribute = $this->findAttributeOr404($id);
     if ($this->attributeHandler->process($attribute)) {
         $request->getSession()->getFlashBag()->add('success', new Message('flash.attribute.updated'));
     }
     return ['form' => $this->attributeForm->createView(), 'locales' => $this->localeRepository->getActivatedLocaleCodes(), 'disabledLocales' => $this->localeRepository->findBy(['activated' => false]), 'measures' => $this->measuresConfig, 'created' => $this->versionManager->getOldestLogEntry($attribute), 'updated' => $this->versionManager->getNewestLogEntry($attribute)];
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:18,代码来源:AttributeController.php

示例10: editAction

 /**
  * Edit channel
  *
  * @param Channel $channel
  *
  * @Template
  * @AclAncestor("pim_enrich_channel_edit")
  * @return array
  */
 public function editAction(Channel $channel)
 {
     if ($this->channelHandler->process($channel)) {
         $this->addFlash('success', 'flash.channel.saved');
         return $this->redirect($this->generateUrl('pim_enrich_channel_edit', array('id' => $channel->getId())));
     }
     return array('form' => $this->channelForm->createView());
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:17,代码来源:ChannelController.php

示例11: editAction

 /**
  * Edit channel
  *
  * @param Channel $channel
  *
  * @Template
  * @AclAncestor("pim_enrich_channel_edit")
  *
  * @return array
  */
 public function editAction(Channel $channel)
 {
     if ($this->channelHandler->process($channel)) {
         $this->request->getSession()->getFlashBag()->add('success', new Message('flash.channel.saved'));
         return new RedirectResponse($this->router->generate('pim_enrich_channel_edit', ['id' => $channel->getId()]));
     }
     return ['form' => $this->channelForm->createView()];
 }
开发者ID:userz58,项目名称:pim-community-dev,代码行数:18,代码来源:ChannelController.php

示例12: editAction

 /**
  * Edit attribute form
  *
  * @param Request $request
  * @param integer $id
  *
  * @Template("PimEnrichBundle:Attribute:form.html.twig")
  * @AclAncestor("pim_enrich_attribute_edit")
  * @return array
  */
 public function editAction(Request $request, $id)
 {
     $attribute = $this->findAttributeOr404($id);
     if ($this->attributeHandler->process($attribute)) {
         $this->addFlash('success', 'flash.attribute.updated');
         return $this->redirectToRoute('pim_enrich_attribute_edit', array('id' => $attribute->getId()));
     }
     return array('form' => $this->attributeForm->createView(), 'locales' => $this->localeManager->getActiveLocales(), 'disabledLocales' => $this->localeManager->getDisabledLocales(), 'measures' => $this->measuresConfig, 'created' => $this->versionManager->getOldestLogEntry($attribute), 'updated' => $this->versionManager->getNewestLogEntry($attribute));
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:19,代码来源:AttributeController.php

示例13: editAction

 /**
  * Edit attribute group
  *
  * @param AttributeGroup $group
  *
  * @Template
  * @AclAncestor("pim_enrich_attributegroup_edit")
  *
  * @return array
  */
 public function editAction(AttributeGroup $group)
 {
     $groups = $this->attributeGroupRepo->getIdToLabelOrderedBySortOrder();
     if ($this->formHandler->process($group)) {
         $this->request->getSession()->getFlashBag()->add('success', new Message('flash.attribute group.updated'));
         return new RedirectResponse($this->router->generate('pim_enrich_attributegroup_edit', ['id' => $group->getId()]));
     }
     return ['groups' => $groups, 'group' => $group, 'form' => $this->form->createView(), 'attributesForm' => $this->getAvailableAttributesForm($this->getGroupedAttributes())->createView()];
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:19,代码来源:AttributeGroupController.php

示例14: editAction

 /**
  * Edit attribute group
  *
  * @param AttributeGroup $group
  *
  * @Template
  * @AclAncestor("pim_enrich_attributegroup_edit")
  *
  * @return array
  */
 public function editAction(AttributeGroup $group)
 {
     $groups = $this->attributeGroupRepo->getIdToLabelOrderedBySortOrder();
     if ($this->formHandler->process($group)) {
         $this->addFlash('success', 'flash.attribute group.updated');
         return $this->redirectToRoute('pim_enrich_attributegroup_edit', ['id' => $group->getId()]);
     }
     return ['groups' => $groups, 'group' => $group, 'form' => $this->form->createView(), 'attributesForm' => $this->getAvailableAttributesForm($this->getGroupedAttributes())->createView()];
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:19,代码来源:AttributeGroupController.php

示例15: transform

 public function transform(Form $form)
 {
     $formView = $form->createView();
     $question = new AlwaysReturnKeyOfChoiceQuestion($this->questionFrom($form), $formView->vars['choices'], $this->defaultValueFrom($form));
     if ($form->getConfig()->getOption('multiple')) {
         $question->setMultiselect(true);
     }
     return $question;
 }
开发者ID:stof,项目名称:symfony-console-form,代码行数:9,代码来源:ChoiceTransformer.php


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