For loop, template

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
CrustyDOD
New php-forum User
New php-forum User
Posts: 13
Joined: Tue Oct 29, 2002 2:58 am

Wed Jul 11, 2007 10:09 am

Hey

I need a simple solution for template using FOR loop. I really do not want to use any of the template engines out there as i only need a FOR loop.

So, i got array with userinfo for example and now i want to output this in template using non-php

in template it would look like:
{LOOP}
id: {LOOP ID}
name: {LOOP NAME}
{/LOOP}

Basically something like Smarty has with SECTION. Any ideas/hints how to do this?
User avatar
WiZARD
Moderator
Moderator
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Fri Jul 13, 2007 12:49 am

CrustyDOD wrote:Hey

I need a simple solution for template using FOR loop. I really do not want to use any of the template engines out there as i only need a FOR loop.

So, i got array with userinfo for example and now i want to output this in template using non-php

in template it would look like:
{LOOP}
id: {LOOP ID}
name: {LOOP NAME}
{/LOOP}

Basically something like Smarty has with SECTION. Any ideas/hints how to do this?
you can see in smarty template how SECTION processing and create separate function/class and integrate in your project....
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image
Post Reply