One of the settings is a checkbox that could be checked/unchecked.
The value is stored, and the checkbox stays the way it was saved. However, I cant get rid of the error message that appears when the checkbox is unchecked.
admin/controller:
Code: Select all
<?php if (isset($this->request->post['show_link'])) {
$data['show_link'] = $this->request->post['show_link'];
} elseif (!empty($module_info)) {
$data['show_link'] = $module_info['show_link'];
} else {
$data['show_link'] = 1;
}
Code: Select all
<?php if (isset($show_link)) { ?>
<label><input type="checkbox" name="show_link" value="1" checked="checked" /></label>
<?php } else { ?>
<label><input type="checkbox" name="show_link" value="1" /></label>
<?php } ?>
Notice: Undefined index: show_link in D:\Server\htdocs\201\admin\controller\module\simple_module.php on line 202
I have tried both with:
<?php if (isset($show_link)) { ?>
and
<?php if ($show_link) { ?>
But still that error message..
What am I doing wrong??