How Insert Php Code In Template file help

Discussion in 'PHP' started by sathyasam, Apr 28, 2008.

  1. #1
    Hi


    I Want To Insert Php Code In .tpl File

    i Cant Insert php Codes In it..


    Any Body have Any Idea.....
     
    sathyasam, Apr 28, 2008 IP
  2. LoCo

    LoCo Well-Known Member

    Messages:
    232
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #2
    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
     
    LoCo, Apr 28, 2008 IP
  3. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #3
    you will need to learn Template programming similar to php but not same

    Regards

    Alex
     
    kmap, Apr 28, 2008 IP