RendererInterface
in
Interface RendererInterface
The interface used for displaying Views and/or theme files.
Table of Contents
Methods
- render() : string
- Builds the output based upon a file name and any data that has already been set.
- renderString() : string
- Builds the output based upon a string and any data that has already been set.
- resetData() : RendererInterface
- Removes all of the view data from the system.
- setData() : RendererInterface
- Sets several pieces of view data at once.
- setVar() : RendererInterface
- Sets a single piece of view data.
Methods
render()
Builds the output based upon a file name and any data that has already been set.
public
render(string $view[, array<string, mixed>|null $options = null ][, bool $saveData = false ]) : string
Parameters
- $view : string
- $options : array<string, mixed>|null = null
-
Reserved for 3rd-party uses since it might be needed to pass additional info to other template engines.
- $saveData : bool = false
-
Whether to save data for subsequent calls
Return values
stringrenderString()
Builds the output based upon a string and any data that has already been set.
public
renderString(string $view[, array<string, mixed>|null $options = null ][, bool $saveData = false ]) : string
Parameters
- $view : string
-
The view contents
- $options : array<string, mixed>|null = null
-
Reserved for 3rd-party uses since it might be needed to pass additional info to other template engines.
- $saveData : bool = false
-
Whether to save data for subsequent calls
Return values
stringresetData()
Removes all of the view data from the system.
public
resetData() : RendererInterface
Return values
RendererInterfacesetData()
Sets several pieces of view data at once.
public
setData([array<string, mixed> $data = [] ][, non-empty-string|null $context = null ]) : RendererInterface
Parameters
- $data : array<string, mixed> = []
- $context : non-empty-string|null = null
-
The context to escape it for. If 'raw', no escaping will happen.
Tags
Return values
RendererInterfacesetVar()
Sets a single piece of view data.
public
setVar(string $name[, mixed $value = null ][, non-empty-string|null $context = null ]) : RendererInterface
Parameters
- $name : string
- $value : mixed = null
- $context : non-empty-string|null = null
-
The context to escape it for. If 'raw', no escaping will happen.