Really simple Smartys?
Moderator: General Moderators
Really simple Smartys?
Has anyone developed a really simple version of smarty? Meaning just iterative sections and variables - I don't want to have such a complicated template system - creates too much overhead in size and loading time.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
store that template block in a seed string, loop over the block list sending the current data through the regex along with the seed string. Store the result into your output buffer or simply echo if no further processing is needed.
I use preg_replace() and the 'e' (evaluate) modifier to do this in my streamlined template engines.
I use preg_replace() and the 'e' (evaluate) modifier to do this in my streamlined template engines.
http://www.acdrifter.com/Templates/Reviews-Template.php
I guess that would be the block that doesn't change.
Every variable with the name "Page____" would be a static variable.
Reviews would be an array of objects
Review would be an object with variables to access - I figure that accessing variables instead of calling methods would be easier for me at this point.
So now that I have that, what kind of regex would iterate over that section?
I guess that would be the block that doesn't change.
Every variable with the name "Page____" would be a static variable.
Reviews would be an array of objects
Review would be an object with variables to access - I figure that accessing variables instead of calling methods would be easier for me at this point.
So now that I have that, what kind of regex would iterate over that section?