Skip to content

Instantly share code, notes, and snippets.

@raphaeldealmeida
Last active December 31, 2015 20:59
Show Gist options
  • Select an option

  • Save raphaeldealmeida/8044065 to your computer and use it in GitHub Desktop.

Select an option

Save raphaeldealmeida/8044065 to your computer and use it in GitHub Desktop.
Exemplos de annotation form builder
<?php
use Zend\Form\Annotation;
/**
* @Annotation\Name("Nome do form")
*
*
* Exemplo de text
* @Annotation\Type("Zend\Form\Element\Text")
* @Annotation\Required({"required":"true"})
* @Annotation\Filter({"name":"StripTags"})
* @Annotation\Filter({"name":"StringToUpper"})
* @Annotation\Validator({"name":"StringLength", "options":{"min":"5"}})
* @Annotation\Options({"label":"Label do elemento:"})
* Exemplo de select
* @Annotation\Type("Zend\Form\Element\Select")
* @Annotation\Required({"required":"true" })
* @Annotation\Filter({"name":"StripTags"})
* @Annotation\Options({"label":"Nota:",
* "value_options" : {"0":"Escolha uma nota","1":"A","2":"B","3":"C"}})
* @Annotation\Validator({"name":"InArray",
* "options":{"haystack":{"1","2","3"},
* "messages":{"notInArray":"Por favor escolha uma nota"}}})
* @Annotation\Attributes({"value":"0"})
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment