ElementSearchForm.php 897B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Muzich\CoreBundle\Form\Search;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormBuilder;
  5. use Muzich\CoreBundle\Searcher\ElementSearcher;
  6. class ElementSearchForm extends AbstractType
  7. {
  8. public function buildForm(FormBuilder $builder, array $options)
  9. {
  10. $builder->add('network', 'choice', array(
  11. 'choices' => array(
  12. ElementSearcher::NETWORK_PUBLIC => 'tout le réseau',
  13. ElementSearcher::NETWORK_PERSONAL => 'mon réseau'
  14. ),
  15. 'required' => true,
  16. ));
  17. $builder->add('tags', 'choice', array(
  18. 'choices' => $options['tags'],
  19. 'expanded' => true,
  20. 'multiple' => true
  21. ));
  22. }
  23. public function getName()
  24. {
  25. return 'element_search_form';
  26. }
  27. public function getDefaultOptions(array $options)
  28. {
  29. return array(
  30. 'tags' => array(),
  31. );
  32. }
  33. }