Forum Moderators: coopster

Message Too Old, No Replies

PHP Templates

         

andrewsmd

1:59 pm on Sep 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm looking for the PHP template file. Does it come automatically with PEAR? If so, what do I have to include in my PHP files to utilize it. If not does anyone have a link to download it. Thanks,

eelixduppy

2:54 pm on Oct 22, 2008 (gmt 0)



Not sure what you are looking for here. Did you find it? PEAR has templating packages, none of which I've used. Is that what you mean?

andrewsmd

3:07 pm on Oct 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I did find it what I was looking for was the HTML_Template_IT file. It requires PEAR but doesn't come with it as a default included file. If you program in PHP you should really look into templates they make life much easier.

cosmoyoda

6:28 pm on Oct 22, 2008 (gmt 0)

10+ Year Member



andrewsmd, I'm not sure what you're looking for. If you're looking a template system in PHP, I suggest you do some research and look up for the Smarty PHP Template Engine.

Smarty helps you:
- Separate application logic from presentation.
- Cache your pages and dramatically speed up your application.
- Use built-in functions or your own custom functions to change the look and feel of your template.

andrewsmd

6:49 pm on Oct 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I looked at smarty and it seems to me like it is basically the same thing as what I used in my previous post. The only difference is with the template class I use you define blocks. Like so
<!-- BEGIN blockName -->
{thisIsATemplateVariable}
<p>some random HTML</p>
{moreVariables}
<!-- END blockName -->
and then set the block with php
and the template variable in basically the same manner.