Re: Best practice: using class on all pages

2014-08-14 Thread Sam Clauw
Okay, outputting an ulli structure with an element is indeed very 
usefull. It can appear in multiple areas on the template files. I 
understand that I should do something like:

echo $this-element('mainmanu', array(
'tree' = array(...),
'active' = array(...)
));

The tree array holds the records and should be calculated with a given 
depth.
The active array holds the parent nodes of the active node.

So far so good I guess? But what do you exactly mean with getting the data 
with a request action?
Sorry if this is a silly question :)

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Best practice: using class on all pages

2014-08-11 Thread thanat
I would use element for rendering and request action to get the correct 
data for menu. 

On Monday, August 11, 2014 12:26:47 AM UTC+2, Sam Clauw wrote:

 I want to write a class that use a left value and a depth value so it can 
 print an ulli output for a menu. I want it to be able in my CMS plugin 
 AND in my front-end pages. My question is: where should I put that class? 
 Some options I've been thinking on:

1. Everything in AppModel.php (disadvantage: file will be too long if 
there are other functions here).
2. Making a behavior and call it's functions in a helper.

 Is one of the above options OK to use, or is there a better way to do so?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Best practice: using class on all pages

2014-08-10 Thread Sam Clauw
I want to write a class that use a left value and a depth value so it can 
print an ulli output for a menu. I want it to be able in my CMS plugin 
AND in my front-end pages. My question is: where should I put that class? 
Some options I've been thinking on:

   1. Everything in AppModel.php (disadvantage: file will be too long if 
   there are other functions here).
   2. Making a behavior and call it's functions in a helper.

Is one of the above options OK to use, or is there a better way to do so?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.