I really like the idea of putting forms into a seperate class that manages validation etc, but I don’t like everything ending up in a DL and also not being able to use square bracket notation in post elements like <input type='checkbox' name='data[]'>.
Is there another way of generating forms – like in views so I can style them the way I want, but also keeping the validation aspect? Also how would I load this view into my current view (using partial view somehow?)
I would suggest going with the full out form ViewScript to manage how your form elements are displayed.
For example, if you wanted them displayed as list items you would have a form that look like this
Then you would have a template at
application/modules/default/views/myForm.phtmlAll elements are called by their declared name like
$this->element->nameNow in your view script you just need to echo the form like you normally would
<?= $this->form; ?>Note I’m using modules, you may or may not have that in the directories and class names
Please consider accepting answers to your questions…
it makes it worth while for those that answer.