do not know how did you injected your $main into template file from "controller".
your can delete that line "<?php include 'header.inc.html.php'; ?>", to see what happen. I have noticed your have "html" in your file name, can you change your file name to "header.php"? (old MS naming style). also change include to "include_once". eclipse has a PHP plugin, which includes a step by step debugging tool. thought I hardly use it, but in this situation, it may help. regards,, anru On 20 November 2010 12:04, Matthew Whiting <[email protected]> wrote: > 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, nor does another > variable $title that is needed in the header template. Played around a > little to try suss what is happening and interestingly, if I include some > other text randomly in this template (but has to be more than just a word or > two), $main does get output e.g. > > <?php include 'header.inc.html.php'; ?> > blah blah blah blah blah blah blah blah > <div><?php echo $main; ?></div> > <?php include 'footer.inc.html.php'; ?> > > Any suggestions as to what might be going on here? Also, ideas as to useful > debugging tools in this type of scenario would be helpful.. > > Cheers > Matt > > > -- > NZ PHP Users Group: http://groups.google.com/group/nzphpug > To post, send email to [email protected] > To unsubscribe, send email to > [email protected] -- NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected]
