PHP Class App\services\Hook

Show file Open project: printempw/blessing-skin-server

Public Methods

Method Description
addMenuItem ( string $category, integer $position, array $menu ) : void Add an item to menu.
addRoute ( Closure $callback ) Add a route. A router instance will be passed to the given callback.

Method Details

addMenuItem() public static method

Add an item to menu.
public static addMenuItem ( string $category, integer $position, array $menu ) : void
$category string 'user' or 'admin'
$position integer Where to insert the given item, start from 0.
$menu array e.g. [ 'title' => 'Title', # will be translated by translator 'link' => 'user/config', # route link 'icon' => 'fa-book' # font-awesome icon ]
return void

addRoute() public static method

Add a route. A router instance will be passed to the given callback.
public static addRoute ( Closure $callback )
$callback Closure