|
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 |
mtnslck Smarty n00b
Joined: 07 May 2017 Posts: 1
|
Posted: Sun May 07, 2017 6:41 pm Post subject: Recursive Function Problem |
|
|
Hi firends,
I'm trying to make a recursive menu. But I can not create function. I can get the main menus. It's okay here. My problem I have not resolved is submenu. I tried hard, but I did not get results. Can you edit my coding?
My function:
{function menuAnasayfa id = 0}
{foreach from=$menuVerisi item=menuEleman}
{if is_array($menuEleman)}
{if $menuEleman.ust_menu_id eq $id}
<li>
<a href="{$menuEleman.link}">{$menuEleman.link_adi}</a>
</li>
{/if}
{/foreach}
{/function}
{menuAnasayfa menuVerisi=$ana_menu}
My Database:
ID LINK_ADI HEDEF UST_MENU_ID
----- ------------ -------- ----------------
1 BOOK _self 0
2 HARROR _self 1
3 ROMAN _self 1 |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sun May 07, 2017 7:25 pm Post subject: |
|
|
Write a plugin, it's easier. |
|
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
|