How do I go about including PHP scripts in TPL scripts? Or vice versa including TPL scripts in PHP scripts? Thanks for your help
To include php functions in a template it must end in .php or the server must be set up to parse that .ext (extension). The syntax for including a file is include ("pathto/filename.xxx"). The options are include, include once, require. Most times the one above is all you will need. If the file is in the same directory the pathto/ is not needed. Paths may be relative ( ./ ../ ) or specific. I prefer relative ./ a directory in this directory. ../ a directory one up from this directory.
What do you mean by tpl files Smarty templates? If so then this should help: {include_php file='/path/to/load_nav.php'} Code (markup): Also check smarty documentation for more info
What part of that did you not understand? I told you they have to be named .php and I showed you how to include them.
This should work: If not, you could always create a .htaccess file in the same directory of the script you're running, asking Apache to parse PHP code in .tpl files as well. Then all you'd need is regular PHP coding (without {php} & {/php}) and it should work.
I think you also need to include smarty class and then copy the templates in template directory and then php fill automatically pick it up.
Guys are we even talking about smarty here? A lot of other developers use template files and most of them are named .tpl.