Welcome Guest, Not a member yet? Register   Sign In
Multiple templates, loading default variables for main template?
#1

[eluser]fancms[/eluser]
Currently I have it set up like so:

- template is the main template that wraps around the content. it contains a variable to echo the content passed by the controller
- in the controller I have it set up so that
$data = all the template variables I need to load for that controller
Code:
$template['content'] = $this->parser->parse('controllertemplatename', $data, true); #calls the parser

- finally, the call to output the whole page:
Code:
$this->parser->parse('maintemplatename', $template);

My problem is that the main template has tags (ie {lang_something}), and those tags are of course not going to get output properly because the $template variable doesn't hold the array for it. I could copy/paste the array with the needed variables but then I'd need to do it for every controller which would make upgrading that menu a nightmare.

Do I need to create a controller for the main template? Is there a way to load the array of variables without copy/pasting it over and over? Am I overlooking something completely obvious? (Wouldn't be the first time Wink)


Messages In This Thread
Multiple templates, loading default variables for main template? - by El Forum - 10-22-2007, 02:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB