Reply to how to loop in templates?

Your name:

Reply:


Posted by metgharab.mestaghrab on 04/24/07 22:50

having developed this simple template engine for my own projects,the
engine simply replaces the {replacable} tags with the appropriate
value.
the template file is read into a string variable $string ,then i use
preg_replace_callback to process the tags.
now,i have a problem with the loops.i've though about this:

{LOOP_NAME}
things to be {repeated}
{/LOOP}

then i though about using preg_replace_callback twice,once to extract
the loop body,repeat it then insert it back into $string.
then use the final preg_replace_callback to replace all {replacable}
variables.
is this a bad idea for server loads?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация