Jump to content

Loop Template Class?


Evan69

Recommended Posts

Hi, i've been working on a templating class, i've got a fully functional class that simply replaces the {TAGS} but what i cannot find a way around is including loops in my class? There are no tutorials on it and only the big engines like smarty have support for loops, and the code is way too complex for me to use it.

 

Im looking for a simple function or functions that will be able to include loops in my class. Any help would be much appreciated.

Link to comment
Share on other sites

Im looking for a simple function or functions that will be able to include loops in my class.

 

Unfortunately, there probably isn't such a thing. Implimenting loops in a template engine is quite complex, hence, unless you have specific needs, why role your own?

 

In fact, I say no to templates all togther. PHP is a template engine, and will do the job much quicker than any other engine.

Link to comment
Share on other sites

agreed with thorpe. PHP can do the trick nicely, unless you have a real need to use custom tag replacement. Take a read of the following article:

 

http://www.massassi.com/php/articles/template_engines/

 

If seperation is your only/main goal, then that will allow you to use PHP but still provide seperation of your templates.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.