Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Lynux\CoreBundle\Form\Type\Configurations;
- use Doctrine\ORM\EntityRepository;
- use Symfony\Component\Form\AbstractType;
- use Symfony\Component\Form\FormBuilderInterface;
- use Symfony\Component\OptionsResolver\OptionsResolverInterface;
- class FormConfigurations extends AbstractType
- {
- /*
- protected $features;
- public function __construct($features)
- {
- $this->features = $features;
- }
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add(
- 'name',
- 'text',
- array(
- 'label' => 'Configuration Name',));
- $builder->add(
- 'domain',
- 'text',
- array(
- 'label' => 'Full Domain Name',));
- $builder->add(
- 'theme',
- 'choice',
- array(
- 'label' => 'Theme',
- 'choices' => array(
- 'theme_wide' => 'Default Theme',
- 'theme_blue' => 'Light Blue Theme',
- 'theme_green' => 'Green Theme'),));
- $builder->add(
- 'layout',
- 'choice',
- array(
- 'label' => 'Default Layout',
- 'choices' => array(
- '1' => '1 Column',
- '2' => '2 Column',
- '3' => '3 Column'),));
- $builder->add(
- 'titleWebsite',
- 'text',
- array(
- 'label' => 'Website Title',));
- $builder->add(
- 'titleBrowser',
- 'text',
- array(
- 'label' => 'Browser Title',));
- $builder->add(
- 'webadmin',
- 'text',
- array(
- 'label' => 'WebAdmin Name',));
- $builder->add(
- 'webadminEmail',
- 'email',
- array(
- 'label' => 'WebAdmin Email',));
- $builder->add(
- 'features',
- 'entity',
- array(
- 'class' => 'LynuxAssetBundle:Core\Codes',
- 'property_path' => false,
- 'query_builder' => function(EntityRepository $er)
- {
- return $er->createQueryBuilder('u')
- ->where('u.submodule = :submodule')
- ->setParameter('submodule', 'feature');
- },
- 'expanded' => true,
- 'multiple' => true,
- 'property' => 'title',));
- }
- public function getName()
- {
- return 'FormConfigurations';
- }
- public function setDefaultOptions(OptionsResolverInterface $resolver)
- {
- $resolver->setDefaults(
- array('data_class' => 'Lynux\AssetBundle\Entity\Core\Configurations',)
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement