Friday, December 30, 2011

Re: Tree Helper Cake 2.0

in main view for some action:

$options = array(
'model' => 'Aco',
'plugin' => 'user',
'element' => 'permission'
);
print $this->Tree->generate($results, $options);


in Element:

in $data variable you have array for each result :)


$results array:

  Array (     [0] => Array         (             [Aco] => Array                 (                     [alias] => AclExtras                     [id] => 225                     [lft] => 2                     [rght] => 3                 )          )      [1] => Array         (             [Aco] => Array                 (                     [alias] => Block                     [id] => 226                     [lft] => 4                     [rght] => 9                 )          )      [2] => Array         (             [Aco] => Array                 (                     [alias] => Blocks                     [id] => 227                     [lft] => 5                     [rght] => 8                 )          )      [3] => Array         (             [Aco] => Array                 (                     [alias] => index2                     [id] => 228                     [lft] => 6                     [rght] => 7                 )          ) 
etc.

--
Lep pozdrav, Tilen Majerle



2011/12/30 Waterschaats <jschoonderbeek@gmail.com>
Serieusly? I've tried and didn't get it to work.
Can you give me an example of the model and controller code you're
using?

Thanks, Dirck

On 30 dec, 09:45, Tilen Majerle <tilen.maje...@gmail.com> wrote:
> http://www.megaupload.com/?d=0UI55OY3
>
> This works for me in 2.0 :)
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2011/12/30 gimmebucks <sapew...@gmail.com>
>
>
>
>
>
>
>
> > I'm looking for it too(2.0).. currently i did it manually (nested
> > loop) and find out that it's quicker than using helpers (1.3)
>
> > On Dec 29, 6:45 pm, Waterschaats <jschoonderb...@gmail.com> wrote:
> > > Is there already a Tree Helper for Cakephp 2.0. I need it to generate
> > > unordered lists.
>
> > > Thanks,
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: