I'm making an "hello world" module . To learn about 2.3
I have the following error: Notice: Undefined variable: error_code in /var/www/html/opencart/admin/view/template/extension/module/helloworld.tpl on line 22
The way it should work is:
helloworld.php:
Code: Select all
/* This block checks, if the hello world text field is set it parses it to view otherwise get the default hello world text field from the database and parse it*/
if (isset($this->request->post['helloworld_text_field'])) {
$data['helloworld_text_field'] = $this->request->post['helloworld_text_field'];
} else {
$data['helloworld_text_field'] = $this->config->get('helloworld_text_field');
}
/* End Block*/
Code: Select all
<td><textarea name="helloworld_text_field" cols="40" rows="5"><?php echo $helloworld_text_field; ?></textarea>