in controller I setup the data for menus
$main = array(
array(
'title' => 'Home',
'url' => '/',
),
array(
'title' => 'About',
'url' => '/about',
),
array(
'title' => 'Articles',
'url' => '/articles',
),
array(
'title' => 'Categories',
'url' => '/categories',
),
array(
'title' => 'Projects',
'url' => '/projects',
),
array(
'title' => 'Contact',
'url' => '/contact',
),
);
$this->set('mainMenu', $menu);
then in view
echo $this->MenuBuilder->build('mainMenu');
- S
On 30 March 2012 15:15, Thomas <[email protected]> wrote:
>
> Basically I now have the following setup which I copied from the git
> repository:
>
> app
> Plugin
> MenuBuilder
> Controller
> Test
> View
>
> I added the following line to /app/config/bootstrap.php:
>
> CakePlugin::load('MenuBuilder');
>
> This is the code I added to /app/Controller/Appcontroller.php:
>
> var $helpers = array('Form', 'Html', 'MenuBuilder.MenuBuilder');
>
> Then I added the code from the MenuBulder sample to the beforeFilter()
> function in the appcontroller.
>
> In my default.ctp I just put the following code:
>
> <div id="header">
>
> <?php echo $this->MenuBuilder->build('main-menu'); ?>
> </div>
>
> ...that was it basically - I hope I did not forget something :)
>
>
> On Thursday, March 29, 2012 1:16:44 PM UTC+2, GoneShootin wrote:
>>
>> Thomas
>>
>> Can you go through how you got it working? I'm beating my head against
>> a brick wall trying to get this to work on 2.1.x!
>>
>> <http://book.cakephp.org/2.0/en/plugins.html>
>
> --
> 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
> [email protected] 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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php