PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Say I got index.php, in which calls for the template index.tpl. And in that index.tpl is all your headers, and footers and such, html code. Say I wanted to have that template have a page include into the top of it. I tried <? PHP include('anewfile.tpl') ?> i've tried just using { } , i've tried linking a .php. Nothing seems to work... here is the code:
Many templating systems don't allow you to directly place PHP code into the template file. As templating system invariably have different feature sets and implementations, you should consult the documentation specific to you template engine to see if A) That particular feature is available and B) If so how.
In many cases you will have to grab the contents of the file and assign it to a variable then pass the variable to your template for inclusion.