PHP Class CroogoNav

Since: 1.4
Author: Rachman Chavik ([email protected])
Inheritance: extends Object
Datei anzeigen Open project: croogo/croogo Class Usage Examples

Protected Properties

Property Type Description
$_activeMenu Current active menu
$_defaults array _defaults
$_items array _items

Public Methods

Method Description
activeMenu ( $menu = null ) Getter/setter for activeMenu
add ( $menu, string $path, array $options = [] ) : void Add a menu item
clear ( $menu = 'sidebar' ) : void Clear all menus
getDefaults ( ) : array Gets default settings for menu items
items ( $menu = 'sidebar', $items = null ) : array Sets or returns menu data in array
menus ( )
remove ( string $path ) : void Remove a menu item

Protected Methods

Method Description
_merge ( array $firstArray, array $secondArray ) : array Merge $firstArray with $secondArray
_replace ( array &$target, string $path, array $options ) : void Replace a menu element
_setupOptions ( array &$options ) : void _setupOptions

Method Details

_merge() protected static method

Similar to Hash::merge, except duplicates are removed
protected static _merge ( array $firstArray, array $secondArray ) : array
$firstArray array
$secondArray array
return array

_replace() protected static method

Replace a menu element
protected static _replace ( array &$target, string $path, array $options ) : void
$target array pointer to start of array
$path string path to search for in dot separated format
$options array data to replace with
return void

_setupOptions() protected static method

_setupOptions
protected static _setupOptions ( array &$options ) : void
$options array
return void

activeMenu() public static method

Getter/setter for activeMenu
public static activeMenu ( $menu = null )

add() public static method

Add a menu item
public static add ( $menu, string $path, array $options = [] ) : void
$path string dot separated path in the array.
$options array menu options array
return void

clear() public static method

Clear all menus
public static clear ( $menu = 'sidebar' ) : void
return void

getDefaults() public static method

Gets default settings for menu items
public static getDefaults ( ) : array
return array

items() public static method

Sets or returns menu data in array
public static items ( $menu = 'sidebar', $items = null ) : array
$items array if empty, the current menu is returned.
return array

menus() public static method

public static menus ( )

remove() public static method

Remove a menu item
public static remove ( string $path ) : void
$path string dot separated path in the array.
return void

Property Details

$_activeMenu protected_oe static_oe property

Current active menu
See also: CroogoNav::activeMenu()
protected static $_activeMenu

$_defaults protected_oe static_oe property

_defaults
protected static array $_defaults
return array

$_items protected_oe static_oe property

_items
protected static array $_items
return array