Hi,
I create a select list with an UI Element like INVO :
The code :
class Elements extends Phalcon\Mvc\User\Component {
public function getUserStatusDropdown() {
$translate = $this->di->get('translate');
$select = "<select class='form-control' id='IsBlocked' name='IsBlocked'>
<option value='-1'>" . $translate->_('Select') . "</option>
<option value='0'>" . $translate->_('Enabled') . "</option>
<option value='1'>" . $translate->_('Disabled') . "</option>
</select>";
echo $select;
}
}
In my view : {{ elements.getUserStatusDropdown() }}
And in my controller, I set all the form data including the select list:
This is what I've try so far :
$this->tag->setDefaults(array('IsBlocked' => $user->IsBlocked)); $this->tag->setDefaults(['IsBlocked' => [$user->IsBlocked]]);
but none of them works, I can't have the option selected.
Any suggestion ?
Thanks