|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ara840 Smarty n00b
Joined: 08 Jun 2003 Posts: 2
|
Posted: Mon Jun 09, 2003 11:37 am Post subject: recursive {section} |
|
|
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 |
|
sweatje Smarty Regular
Joined: 17 Apr 2003 Posts: 70 Location: Bettendorf, Iowa, USA
|
Posted: Mon Jun 09, 2003 11:43 am Post subject: |
|
|
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 |
|
ara840 Smarty n00b
Joined: 08 Jun 2003 Posts: 2
|
Posted: Mon Jun 09, 2003 12:30 pm Post subject: |
|
|
thanks.. very helpful. |
|
Back to top |
|
|
|
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
|