Hi,

> Kia ora all,
>
> Can't quite figure what is happening in a wee piece of code I'm writing..
> $main is defined in a 'controller', then the template file is included,
> which has three lines of code:
>
> <?php include 'header.inc.html.php'; ?>
> <div><?php echo $main; ?></div>
> <?php include 'footer.inc.html.php'; ?>
>
> Interestingly, $main does not end up in the output,

Is this template file included in the same function of the
"controller" where $main is defined? Otherwise it is out of scope.

This sounds like system that may be widely used, the solution then is
usually to access $main through $this->main,
$this->templatevariables['main'] or something like that.

The answer could also be that you need
global $main;
in your controller, but thats not an avenue I would pursue if this is
your own system.

We may need more info on this problem.

HTH,

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to