Looking for some advice

Discussion in 'PHP' started by Eran-s, Apr 9, 2007.

  1. #1
    I'm developing a few scripts and I would like to keep the html outside the code, that will be done with the help of a template engine.

    I know that Smarty is a good one, but I think about develope a simple one for my own use, what will be better?
    I had another question, someone knows a better why how could I make for example an If condition into the template file? (Without using REGEX)


    Thanks,
    Eran.
     
    Eran-s, Apr 9, 2007 IP
  2. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #2
    PHP+HTML is already a template engine.

    Do you want an "if" condition into the "template" file?

    <?php if ($condition === true) : ?>
      some html
    <?php else : ?>
      some other html
    <?php endif ?>
    PHP:
    Why re-inventing the wheel each time?!?
     
    picouli, Apr 9, 2007 IP
  3. Eran-s

    Eran-s Peon

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No, I'm using tpl files for the html codes and I'm parsing it with PHP files.
     
    Eran-s, Apr 9, 2007 IP
  4. OwenC

    OwenC Peon

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Is this .tpl file some sort of template you made up or are you using a tempalte engine ?
     
    OwenC, Apr 9, 2007 IP
  5. Eran-s

    Eran-s Peon

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The .tpl files contain the html data of the design
     
    Eran-s, Apr 9, 2007 IP