Evan69 Posted November 20, 2007 Share Posted November 20, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/78082-loop-template-class/ Share on other sites More sharing options...
trq Posted November 20, 2007 Share Posted November 20, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/78082-loop-template-class/#findComment-395182 Share on other sites More sharing options...
redbullmarky Posted November 20, 2007 Share Posted November 20, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/78082-loop-template-class/#findComment-395239 Share on other sites More sharing options...
Evan69 Posted November 22, 2007 Author Share Posted November 22, 2007 okay, thanks that was exactly what i needed. Quote Link to comment https://forums.phpfreaks.com/topic/78082-loop-template-class/#findComment-396634 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.