Credit Cards - Mortgages - Buy Anything On eBay - Equity Release - Mortgages

PDA

View Full Version : How Insert Php Code In Template file help


sathyasam
Apr 28th 2008, 8:26 am
Hi


I Want To Insert Php Code In .tpl File

i Cant Insert php Codes In it..


Any Body have Any Idea.....

LoCo
Apr 28th 2008, 8:35 am
you will have to explain a little more, do you use any template engine like smarty ? (usually uses .tpl extension for templates files)

if so you will need to pass your php variable to the smarty engine
STemplate::assign('variable-name-you-want-to-use-in-template','$php-variablename')

otherwise if you dont use any template engine you should be fine by doing <?php $variablename ?>

example with HTML

<a href="somelink"><?php $variablename ?></a>

hope its what you was looking for

regards

kmap
Apr 28th 2008, 8:53 am
you will need to learn Template programming similar to php but not same

Regards

Alex