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 Function Problem

 
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 -> General
View previous topic :: View next topic  
Author Message
mtnslck
Smarty n00b


Joined: 07 May 2017
Posts: 1

PostPosted: Sun May 07, 2017 6:41 pm    Post subject: Recursive Function Problem Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sun May 07, 2017 7:25 pm    Post subject: Reply with quote

Write a plugin, it's easier.
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 -> General 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