Hei there!
I would like to pass additional parameters to a form. Right now the form renderer takes a value to define the form, and an array to present additional html tags (like css class, etc).
Is it possible to add another array of values?
Lets assume I want to render a list of select boxes for all items I have in a database. The select boxes shall contain all categories/memberships of -each- item from the database.
So I would like to use this template:
{% for item in items_list %}
{{ form('/controller/action') }}
<?php echo $form->render(
"form_name",
array('class' =>'css-class'),
/*additional array to pass to form*/
array('a' => 'value a','b' => 'value b','c' => 'value c')
) ?>
</form>
{% endfor %}
And now the FormNameForm.php: ??
<?php
use Phalcon\Forms\Form;
use Phalcon\Forms\Element\Select;
use Phalcon\Models\MyModel;
class FormName extends Form
{
// What to do here? :/
}
Is my approach possible? Or is there another way?
greetings