12-20-2007, 12:39 PM
|
#4 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
This is going off topic, but Kohana takes the View as just another object to be manipulated. Member variables can be set dynamically which are then available in the templates files. For example:
PHP Code:
// Code in Controller $view = new View ('mytemplate'); $view-> myVar = 'myData'; $view-> render(TRUE); // In the template<strong><?php echo $myVar; ?></strong>
Back to the original topic, chances are that you're looking at an issue of scope. The header appears to be loaded inside of a class method (on the $tpl object) so the global variables ($user, $site ...) will not be available unless you're using 'global $site' to provide access, or $GLOBALS['site'], or passing those into the template class/methods.
For a test, you could try and var_dump($site) (from inside the header() method) just to see if the object is available to use.
|
|
|
|