From 0dc10d509744c624eb79377dc37994c81fa10ed1 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 1 Jul 2013 11:20:40 +0200 Subject: [PATCH] add some phpdoc for form creation explanation --- core/lib/Thelia/Form/BaseForm.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/lib/Thelia/Form/BaseForm.php b/core/lib/Thelia/Form/BaseForm.php index cbcebf173..3c76df1b5 100644 --- a/core/lib/Thelia/Form/BaseForm.php +++ b/core/lib/Thelia/Form/BaseForm.php @@ -77,7 +77,31 @@ abstract class BaseForm { return $this->form->getForm(); } + /** + * + * in this function you add all the fields you need for your Form. + * Form this you have to call add method on $this->form attribute : + * + * $this->form->add("name", "text") + * ->add("email", "email", array( + * "attr" => array( + * "class" => "field" + * ), + * "label" => "email", + * "constraints" => array( + * new NotBlank() + * ) + * ) + * ) + * ->add('age', 'integer'); + * + * @return null + */ abstract protected function buildForm(); + + /** + * @return string the name of you form. This name must be unique + */ abstract public function getName(); }