Page 1 of 1

templates, does something unset() things?

Posted: Mon Feb 16, 2009 2:45 pm
by asimons999
Gday.

How come when I copy and paste $variable elements to another template file, it says the variable isn't defined? Is something dynamically setting and unset()ing them in a way to stop other template files from being able to access that data?

Re: templates, does something unset() things?

Posted: Mon Feb 16, 2009 5:39 pm
by fido-x
Basically, there are 3 files you need to look at -- the controller file, the language file and the template file.

The variable is declared in the controller and passed through to the template, while the value of the variable may come from the language file or extracted from the database.

Have a look in the controller file with the same name as the template file, you will find something like --

Code: Select all

$this->data['variable_name'] = $this->language->get['variable_name'];
And in the associated language file --

Code: Select all

$_['variable_name'] = 'Some value';
Fido-X.