Hi all, I'm working with From radio group, I want to select boolen 1 or 0
$enable = new \Phalcon\Forms\Element\Radio("enable", ['name' => 'enable', 'value' => '1']);
$enable->setLabel('Enable:');
$hidden = new \Phalcon\Forms\Element\Radio("hidden", ['name' => 'enable', 'value' => '0']);
$hidden->setLabel('Hidden:');
In view
<div class="form-group"> {{ form.label('enable') }} {{ form.render('enable') }} {{ form.label('hidden') }} {{ form.render('hidden') }} </div>
In controller
if ($this->request->isPost()) {
$params = $this->request->getPost();
if ($form->isValid($params) == true) {
//true
} else {
$messages = $form->getMessages();
}
}
I tried to submit to return to the page current, but the value 0 is not selected. I using phalcon v2.1. Please help me