Advertisement
Guest User

Form definition.

a guest
Nov 8th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <?php
  2.  
  3. namespace BaseReality\Form;
  4.  
  5. use Intahwebz\Form\Form;
  6.  
  7. class LinkEditForm extends Form{
  8.  
  9. function getDefinition() {
  10. $definition = array(
  11.  
  12. 'startElements' => [
  13. [
  14. 'type' => \Intahwebz\FormElement\Title::class,
  15. 'value' => 'Link add',
  16. ]
  17. ],
  18.  
  19. 'rowElements' => array(
  20. array(
  21. 'type' => \Intahwebz\FormElement\Text::class,
  22. 'label' => 'Description',
  23. 'name' => 'description',
  24. 'validation' => array(
  25. "Zend\\Validator\\StringLength" => array(
  26. 'min' => 8,
  27. ),
  28. )
  29. ),
  30. array(
  31. 'type' => \Intahwebz\FormElement\Text::class,
  32. 'label' => 'URL',
  33. 'name' => 'url',
  34. 'validation' => array(
  35. \Intahwebz\Validator\URL::class => array(),
  36. ),
  37. ),
  38. ),
  39.  
  40. 'endElements' => array(
  41. array(
  42. 'submitButton',
  43. 'type' => \Intahwebz\FormElement\SubmitButton::class,
  44. 'label' => null,
  45. 'text' => 'Add link',
  46. ),
  47. ),
  48.  
  49. 'validation' => array(
  50. //form level validation.
  51. )
  52. );
  53.  
  54. return $definition;
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement