本文整理汇总了PHP中Symfony\Component\Form\FormBuilder::prependClientTransformer方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::prependClientTransformer方法的具体用法?PHP FormBuilder::prependClientTransformer怎么用?PHP FormBuilder::prependClientTransformer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Form\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::prependClientTransformer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildForm
public function buildForm(FormBuilder $builder, array $options)
{
if ($options['multiple']) {
$builder->prependClientTransformer(new ModelsToArrayTransformer($options['choice_list']));
} else {
$builder->prependClientTransformer(new ModelToIdTransformer($options['choice_list']));
}
}
示例2: buildForm
public function buildForm(FormBuilder $builder, array $options)
{
if ($options['multiple']) {
$builder->addEventSubscriber(new MergeCollectionListener())->prependClientTransformer(new ModelsToArrayTransformer($options['choice_list']));
} else {
$builder->prependClientTransformer(new ModelToIdTransformer($options['choice_list']));
}
}
示例3: buildForm
public function buildForm(FormBuilder $builder, array $options)
{
$builder->prependClientTransformer(new CategoriesCollectionTransformer($options['entityCategoryClass']))->addEventSubscriber(new CategoriesMergeCollectionListener());
$registries = \CategoryRegistryUtil::getRegisteredModuleCategories($options['module'], $options['entity'], 'id');
foreach ($registries as $registryId => $categoryId) {
$builder->add('registry_' . $registryId, 'entity', array('class' => 'Zikula\\Core\\Doctrine\\Entity\\Category', 'property' => 'name', 'query_builder' => function (EntityRepository $repo) use($categoryId) {
//TODO: (move to)/use own entity repository after CategoryUtil migration
return $repo->createQueryBuilder('e')->where('e.parent = :parentId')->setParameter('parentId', (int) $categoryId);
}));
}
}
示例4: buildForm
public function buildForm(FormBuilder $builder, array $options)
{
if ($options['multiple']) {
$builder->prependClientTransformer(new CollectionToArrayTransformer());
}
}
示例5: buildForm
public function buildForm(FormBuilder $builder, array $options)
{
$builder->prependClientTransformer(new ModelToIdTransformer($options['model_manager'], $options['class']));
}
示例6: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilder $builder, array $options)
{
$builder->prependClientTransformer(new ModelsToArrayTransformer($options['choice_list']));
$this->choices = $options['choice_list']->getChoices();
unset($options['choices']);
}
示例7: buildForm
public function buildForm(FormBuilder $builder, array $options)
{
$builder->prependClientTransformer(new OneEntityToIdTransformer($this->registry->getEntityManager($options['em']), $options['class'], $options['property'], $options['query_builder']));
}