Documentation

FormRenderer
in package
implements FormRendererInterface

Renders a form into HTML using a rendering engine.

Tags
author

Bernhard Schussek bschussek@gmail.com

Table of Contents

Interfaces

FormRendererInterface
Renders a form into HTML.

Constants

CACHE_KEY_VAR  = 'unique_block_prefix'

Properties

$blockNameHierarchyMap  : array<string|int, mixed>
$csrfTokenManager  : mixed
$engine  : mixed
$hierarchyLevelMap  : array<string|int, mixed>
$variableStack  : array<string|int, mixed>

Methods

__construct()  : mixed
getEngine()  : FormRendererEngineInterface
Returns the engine used by this renderer.
humanize()  : string
Makes a technical name human readable.
renderBlock()  : string
Renders a named block of the form theme.
renderCsrfToken()  : string
Renders a CSRF token.
searchAndRenderBlock()  : string
Searches and renders a block for a given name suffix.
setTheme()  : mixed
Sets the theme(s) to be used for rendering a view and its children.

Constants

CACHE_KEY_VAR

public mixed CACHE_KEY_VAR = 'unique_block_prefix'

Properties

$blockNameHierarchyMap

private array<string|int, mixed> $blockNameHierarchyMap = []

$hierarchyLevelMap

private array<string|int, mixed> $hierarchyLevelMap = []

$variableStack

private array<string|int, mixed> $variableStack = []

Methods

humanize()

Makes a technical name human readable.

public humanize(string $text) : string
Parameters
$text : string
Return values
string

renderBlock()

Renders a named block of the form theme.

public renderBlock(FormView $view, string $blockName[, array<string|int, mixed> $variables = [] ]) : string
Parameters
$view : FormView

The view for which to render the block

$blockName : string
$variables : array<string|int, mixed> = []

The variables to pass to the template

Return values
string

renderCsrfToken()

Renders a CSRF token.

public renderCsrfToken(string $tokenId) : string
Parameters
$tokenId : string
Return values
string

searchAndRenderBlock()

Searches and renders a block for a given name suffix.

public searchAndRenderBlock(FormView $view, string $blockNameSuffix[, array<string|int, mixed> $variables = [] ]) : string
Parameters
$view : FormView

The view for which to render the block

$blockNameSuffix : string
$variables : array<string|int, mixed> = []

The variables to pass to the template

Return values
string

setTheme()

Sets the theme(s) to be used for rendering a view and its children.

public setTheme(FormView $view, mixed $themes[, bool $useDefaultThemes = true ]) : mixed
Parameters
$view : FormView

The view to assign the theme(s) to

$themes : mixed

The theme(s). The type of these themes is open to the implementation.

$useDefaultThemes : bool = true

If true, will use default themes specified in the renderer


        
On this page

Search results