it's not striclty cake question,
parent_id and findAllThreaded(); works fine,
but, how to write recursive function instead this what I have in
element code ?

in component:

$Groups = $Group->findAllThreaded();
                $this->controller->set('Groups', $Groups);

in element:

<?php foreach($Groups as $Group) { ?>
                <?php echo $html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item')) ?>
                <?php //pr($Group); ?>
                <?php foreach($Group['children'] as $Group) { ?>
                        <?php echo $html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under')) ?>
                                <?php foreach($Group['children'] as $Group) { ?>
                                        <?php echo 
$html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under2')) ?>
                                                <?php 
foreach($Group['children'] as $Group) { ?>
                                                        <?php echo 
$html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under3')) ?>
                                                                <?php 
foreach($Group['children'] as $Group) { ?>
                                                                        <?php 
echo $html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under4')) ?>
                                                                                
<?php foreach($Group['children'] as $Group) { ?>
                                                                                
        <?php echo $html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under5')) ?>
                                                                                
<?php } ?>
                                                                <?php } ?>
                                                <?php } ?>
                                <?php } ?>
                <?php } ?>
        <?php } ?>

X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.11.53.63 with SMTP id b63mr134579cwa;
        Mon, 22 May 2006 13:13:03 -0700 (PDT)
X-Google-Token: IUimfAwAAABUCuLAEwFzOSHMriWx256r
Received: from 83.7.25.118 by j55g2000cwa.googlegroups.com with HTTP;
        Mon, 22 May 2006 20:13:03 +0000 (UTC)
From: "kwdowicz" <[EMAIL PROTECTED]>
To: "Cake PHP" <[email protected]>
Subject: Re: Recursivity
Date: Mon, 22 May 2006 13:13:03 -0700
Message-ID: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.0.3) 
Gecko/20060426 Firefox/1.5.0.3,gzip(gfe),gzip(gfe)
Mime-Version: 1.0
Content-Type: text/plain

it's not striclty cake question,
parent_id and findAllThreaded(); works fine,
but, how to write recursive function instead this what I have in
element code ?

in component:

$Groups = $Group->findAllThreaded();
                $this->controller->set('Groups', $Groups);

in element:

<?php foreach($Groups as $Group) { ?>
                <?php echo $html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item')) ?>
                <?php //pr($Group); ?>
                <?php foreach($Group['children'] as $Group) { ?>
                        <?php echo $html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under')) ?>
                                <?php foreach($Group['children'] as $Group) { ?>
                                        <?php echo 
$html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under2')) ?>
                                                <?php 
foreach($Group['children'] as $Group) { ?>
                                                        <?php echo 
$html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under3')) ?>
                                                                <?php 
foreach($Group['children'] as $Group) { ?>
                                                                        <?php 
echo $html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under4')) ?>
                                                                                
<?php foreach($Group['children'] as $Group) { ?>
                                                                                
        <?php echo $html->link($Group['Group']['name'],
"/products/index/{$Group['Group']['id']}", array('class' =>
'menu_item_under5')) ?>
                                                                                
<?php } ?>
                                                                <?php } ?>
                                                <?php } ?>
                                <?php } ?>
                <?php } ?>
        <?php } ?>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to