public function __construct($itemId, $config) { if (array_key_exists('group', $config)) { $this->group($config['group']); unset($config['group']); } parent::__construct($itemId, $config); if (array_key_exists('checked', $config)) { $this->checked = true; } }
public function __construct($itemId, $config) { if (array_key_exists('group', $config)) { $this->group($config['group']); unset($config['group']); } parent::__construct($itemId, $config); if (array_key_exists('checked', $config)) { $this->checked = true; } $this->attributes()->add('class', 'onoffswitch-checkbox'); }