Navigation
class Navigation
Traits
Adds event related features to any class.
Properties
array | $vars | from ViewMaker | |
array | $viewPath | from ViewMaker | |
array | $layoutPath | from ViewMaker | |
array | $partialPath | from ViewMaker | |
string | $layout | from ViewMaker | |
bool | $suppressLayout | from ViewMaker | |
protected | $viewFileExtension | from ViewMaker | |
protected array | $emitterSingleEvents | from EventEmitter | |
protected array | $emitterEvents | from EventEmitter | |
protected array | $emitterEventSorted | from EventEmitter | |
protected | $navItems | ||
protected | $mainItems | ||
protected | $navItemsLoaded | ||
protected | $navContextItemCode | ||
protected | $navContextParentCode | ||
protected | $callbacks |
Methods
Guess the package path from a specified class.
Render a layout.
Render a partial file contents located in the views or partial folder.
Includes a file path using output buffering.
Create a new event binding.
Create a new event binding that fires once only
Sort the listeners for a given event by priority.
Fire an event and call the listeners.
Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Registers a callback function that defines navigation items.
Details
in
ViewMaker at line 50
getViewPath($view, $viewPath = null)
No description
in
ViewMaker at line 78
guessViewFileExtension($path)
No description
in
ViewMaker at line 98
string
guessViewPath(string $suffix = '', bool $isPublic = false)
Guess the package path from a specified class.
in
ViewMaker at line 119
mixed
makeLayout(string $name = null, array $vars = [], bool $throwException = true)
Render a layout.
in
ViewMaker at line 147
string
makeView(string $view)
Loads a view with the name specified.
Applies layout if its name is provided by the parent object. The view file must be situated in the views directory, and has the extension "htm" or "php".
in
ViewMaker at line 171
mixed
makePartial(string $partial, array $vars = [], bool $throwException = true)
Render a partial file contents located in the views or partial folder.
in
ViewMaker at line 199
string
makeFileContent(string $filePath, array $extraParams = [])
Includes a file path using output buffering.
Ensures that vars are available.
in
ViewMaker at line 235
compileFileContent($filePath)
No description
in
ViewMaker at line 256
protected void
handleViewException(Exception $e, int $obLevel)
Handle a view exception.
in
ViewMaker at line 271
protected array
gatherViewData($data)
Get the data bound to the view instance.
in
EventEmitter at line 36
EventEmitter
bindEvent(string $event, callable $callback, int $priority = 0)
Create a new event binding.
in
EventEmitter at line 52
EventEmitter
bindEventOnce(string $event, callable $callback)
Create a new event binding that fires once only
in
EventEmitter at line 66
protected void
emitterEventSortEvents(string $eventName)
Sort the listeners for a given event by priority.
in
EventEmitter at line 84
EventEmitter
unbindEvent(string $event = null)
Destroys an event binding.
in
EventEmitter at line 124
string|array
fireEvent(string $event, array $params = [], bool $halt = false)
Fire an event and call the listeners.
in
EventEmitter at line 178
mixed
fireSystemEvent(string $event, array $params = [], bool $halt = true)
Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.
For example:
$this->fireSystemEvent('admin.form.myEvent', ['my value']);
Is equivalent to:
$this->fireEvent('form.myEvent', ['myvalue'], true);
Event::fire('admin.form.myEvent', [$this, 'myvalue'], true);
at line 28
__construct($path = null)
No description
at line 33
setContext($itemCode, $parentCode = null)
No description
at line 39
getNavItems()
No description
at line 47
isCollapsed()
No description
at line 52
getVisibleNavItems()
No description
at line 77
isActiveNavItem($code)
No description
at line 88
getMainItems()
No description
at line 96
render($partial)
No description
at line 105
addNavItem($itemCode, array $options = [], $parentCode = null)
No description
at line 134
mergeNavItem($itemCode, array $options = [], $parentCode = null)
No description
at line 146
removeNavItem($itemCode, $parentCode = null)
No description
at line 156
loadItems()
No description
at line 187
filterPermittedNavItems($items)
No description
at line 201
registerMainItems($definitions = null)
No description
at line 212
registerNavItems($definitions = null, $parent = null)
No description
at line 229
registerNavItem($code, $item, $parent = null)
No description
at line 252
registerCallback(callable $callback)
Registers a callback function that defines navigation items.
The callback function should register permissions by calling the manager's registerNavItems() function. The manager instance is passed to the callback function as an argument. Usage:
Template::registerCallback(function($manager){ $manager->registerNavItems([...]); });