Sunday, September 19, 2010

Helper or Element?

Hi all.

I'm wanting to create a simple helper or element which displays a menu. I've read around and have seen that others have created helpers which create dynamic, database-driven, nested menus. This seems to be too much for my needs. I also tend to think that the creation of a menu should be in an element.... just cuz it seems "more appropriate" - wish I had more justification.

<?php
$this->element('menu', array(
'items' => array(
'First' => array('attr'=>'...'),
'Second' => array('attr'=>'...'),
'Third' => array('attr'=>'...'),
),
));
?>

Then in the element just loop through the items and display them in an unordered list.

So, which would be more appropriate for this functionality - an element or a helper? And why?

Thanks!
~Philip

http://lonestarlightandsound.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate