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
https://forums.phpfreaks.com/topic/78082-loop-template-class/
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
https://forums.phpfreaks.com/topic/78082-loop-template-class/#findComment-395182
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
https://forums.phpfreaks.com/topic/78082-loop-template-class/#findComment-395239
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.