Rendering
in package
The rendering class
This class is the core for custom rendering use.
Table of Contents
Properties
- $current : Rendering
- The current global rendering
- $layoutStack : array<string|int, mixed>
- The rendering layout stack
- $menusConfig : Config
- The configuration of the menu
- $renderingStack : array<string|int, mixed>
- The current rendering stack
Methods
- captureOutput() : void
- Start capture of buffer
- display() : void
- Display rendering
- endCapture() : bool|string
- End capture of buffer
- endCurrentLayout() : bool
- End the current layout
- getCurrent() : static
- getMenuItems() : array<string|int, string>
- Get menu items
- render() : string|null
- Render the model This function does not display the result, see display().
- showMenu() : void
- Show the $menu
- startNewBlock() : void
- Start new block capture
- useLayout() : void
- Use layout until the next endCurrentLayout()
- getCurrentRendering() : array<string|int, mixed>|null
- Get current rendering
- pullFromStack() : void
- Remove current rendering and get to previous one
- pushToStack() : void
- Push rendering to stack
Properties
$current
The current global rendering
protected
static Rendering
$current
$layoutStack
The rendering layout stack
protected
static array<string|int, mixed>
$layoutStack
= []
$menusConfig
The configuration of the menu
protected
static Config
$menusConfig
$renderingStack
The current rendering stack
protected
array<string|int, mixed>
$renderingStack
= []
Methods
captureOutput()
Start capture of buffer
public
static captureOutput() : void
display()
Display rendering
public
display([string|null $layout = null ][, array<string|int, mixed> $env = [] ]) : void
Parameters
- $layout : string|null = null
-
The layout to use
- $env : array<string|int, mixed> = []
-
An environment variable
endCapture()
End capture of buffer
public
static endCapture() : bool|string
Return values
bool|stringendCurrentLayout()
End the current layout
public
endCurrentLayout([array<string|int, mixed> $env = [] ]) : bool
Parameters
- $env : array<string|int, mixed> = []
-
The environment to render the layout
Return values
bool —False if there is no current layout
getCurrent()
public
static getCurrent() : static
Return values
staticgetMenuItems()
Get menu items
public
getMenuItems(string $menu) : array<string|int, string>
Parameters
- $menu : string
-
The menu to get items
Return values
array<string|int, string> —The menu items
render()
Render the model This function does not display the result, see display().
public
abstract render([string|null $layout = null ][, array<string|int, mixed> $env = [] ]) : string|null
Parameters
- $layout : string|null = null
-
The layout to use, default use is defined by child
- $env : array<string|int, mixed> = []
-
An environment variable, commonly an array but depends on the rendering class used
Return values
string|null —The generated rendering
showMenu()
Show the $menu
public
showMenu(string $menu[, string|null $layout = null ][, string|null $activeLink = null ]) : void
Parameters
- $menu : string
-
The menu name
- $layout : string|null = null
-
the layout to use
- $activeLink : string|null = null
-
Active item link
Tags
startNewBlock()
Start new block capture
public
startNewBlock(string $name) : void
Parameters
- $name : string
useLayout()
Use layout until the next endCurrentLayout()
public
useLayout(string $layout[, string $block = 'content' ]) : void
Parameters
- $layout : string
-
The layout to use.
- $block : string = 'content'
Tags
getCurrentRendering()
Get current rendering
protected
getCurrentRendering() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —array($layout, $env);
pullFromStack()
Remove current rendering and get to previous one
protected
pullFromStack() : void
pushToStack()
Push rendering to stack
protected
pushToStack(string $layout, array<string|int, mixed> $env) : void
Parameters
- $layout : string
- $env : array<string|int, mixed>