Last active
August 29, 2015 14:00
-
-
Save leknoppix/11408543 to your computer and use it in GitHub Desktop.
Menu with treebehavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* view */ | |
<?php | |
echo $this->Menu->create($pages, | |
'', | |
'pages', | |
'view', | |
array( | |
0 => array('name' => 'Accueil', | |
'controller' => 'posts', | |
'action' => 'index' | |
), | |
), | |
array( | |
0 => array( | |
'name' => 'Contact', | |
'controller' => 'contacts', | |
'action' => 'index' | |
), | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function index() { | |
$pages = $this->Page->find('threaded', array( | |
'conditions' => array('Page.menu_id' => 1), | |
'fields' => array( | |
'Page.id', | |
'Page.name', | |
'Page.slug', | |
'Page.parent_id' | |
), | |
'order' => array('Page.lft ASC'), | |
)); | |
$this->set('pages', $pages); | |
$this->render('index'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: Add the help on the tableController: