getDefaults() public static method

Gets default settings for menu items
public static getDefaults ( ) : array
return array
示例#1
0
 public function testNavOverwrite()
 {
     $defaults = CroogoNav::getDefaults();
     $items = CroogoNav::items();
     $expected = Hash::merge($defaults, array('title' => 'Permissions', 'url' => array('admin' => true, 'plugin' => 'acl', 'controller' => 'acl_permissions', 'action' => 'index'), 'weight' => 30));
     $this->assertEquals($expected, $items['users']['children']['permissions']);
     $item = array('title' => 'Permissions', 'url' => array('admin' => true, 'plugin' => 'acl_extras', 'controller' => 'acl_extras_permissions', 'action' => 'index'), 'weight' => 30);
     CroogoNav::add('users.children.permissions', $item);
     $items = CroogoNav::items();
     $expected = Hash::merge($defaults, array('title' => 'Permissions', 'url' => array('admin' => true, 'plugin' => 'acl_extras', 'controller' => 'acl_extras_permissions', 'action' => 'index'), 'weight' => 30));
     $this->assertEquals($expected, $items['users']['children']['permissions']);
 }