Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

recursive {section}

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
ara840
Smarty n00b


Joined: 08 Jun 2003
Posts: 2

PostPosted: Mon Jun 09, 2003 11:37 am    Post subject: recursive {section} Reply with quote

ive tried to make a menu system that take an array as input an make a menu of it. the array looks something like this:

$menu = array( 0 => array( 'id' => 'main',
'link' => 'main.php' ),
1 => array( 'id' => 'sub',
'sub' => array( 0 => array( 'id' => 'text',
'link' => '...' ),
1 => array( 'id' => 'bla',
'link' => '...' )
)
)
);

so the menu would be something like:

main
sub
text
bla

the id "tag" gives the name of the item, if link is given it enclose the item with <a href=".."> item </a>, and if sub is given it creates sub meny..

if it where no sub meny it would be easy, but with the submeny it the code gets twice as big. and it doesnt support multiple sub menus.. so a recursive section system would work great.. each time it encountered a sub "tag" it startes the section again and maybe set a $number var that says what level it is in..

just an idea..
Back to top
View user's profile Send private message
sweatje
Smarty Regular


Joined: 17 Apr 2003
Posts: 70
Location: Bettendorf, Iowa, USA

PostPosted: Mon Jun 09, 2003 11:43 am    Post subject: Reply with quote

Have you looked at this thread to see if it might help with your issue?
_________________
Jason
jsweat_php AT yahoo DOT com
Back to top
View user's profile Send private message
ara840
Smarty n00b


Joined: 08 Jun 2003
Posts: 2

PostPosted: Mon Jun 09, 2003 12:30 pm    Post subject: Reply with quote

thanks.. very helpful.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP