Hi all,
Just struggling with the forms in Phalcon.
I need to create a list of options: <input type="checkbox" name="list[]" value="option1"> <input type="checkbox" name="list[]" value="option2"> <input type="checkbox" name="list[]" value="option2">
<?php foreach ($list as $option) { $this->add(new Check('list[]', array('value' => 1))); } ?>
Then, I wanted to overload the bind method from form to join selected checkboxes into single variable
<?php public function bind(array $data, $entity, $whitelist = null) { $entity->list = implode(',', $data['list']); return parent::bind($data, $entity, $whitelist); } ?>
What is the suggested approach to achieve this with phalcon forms and models?