Your existing menu is likely a series of <li> elements with <a href=""> in them, yes? Replace the <a> elements with <?php this->Html->link() ?> calls. A good place to set this up is in app/View/Layouts/default.ctp.
-- -Rob
On Monday, October 19, 2015 at 3:41:44 AM UTC-4, Simon Bradley wrote:
On Monday, October 19, 2015 at 3:41:44 AM UTC-4, Simon Bradley wrote:
HiI'm new to cakephpI'm using version 3I've been working through an existing site i have built and trying to replicate it with cakephpI did a lot very quickly which is great but the menu is trickySince this is a navigation bar at the top of every page i thought i might use an elementThe problem there seems to be getting the data into it from the databaseI've read the manual quite a bit and based on that i thought maybe creating a model and controller for the menu would be the best way to goThen i could call the menu controller from the article controller and get the menu data that wayIt looks like i can pass the data into the menu element from there?But then where do i put the code that actually takes the data and generates the menu?I've looked at various tutorials but it's not made things clearerI'd really appreciate some advice here folks.Cheers.
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+unsubscribe@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.
No comments:
Post a Comment