RendererInterface
Renderer interface.
Table of Contents
Methods
- __construct() : mixed
- addGlobal() : void
- Adds a global variable.
- addTransResource() : void
- Adds a translation file.
- getDebugProfile() : Profile|null
- Returns debug profile.
- render() : string
- Rendering.
- setLocale() : void
- Set locale (e.g.: 'fr_FR').
Methods
__construct()
public
__construct(Builder $buider, string|array<string|int, mixed> $templatesPath) : mixed
Parameters
- $buider : Builder
- $templatesPath : string|array<string|int, mixed>
addGlobal()
Adds a global variable.
public
addGlobal(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
addTransResource()
Adds a translation file.
public
addTransResource(string $translationsDir, string $locale) : void
Parameters
- $translationsDir : string
- $locale : string
getDebugProfile()
Returns debug profile.
public
getDebugProfile() : Profile|null
Return values
Profile|nullrender()
Rendering.
public
render(string $template, array<string|int, mixed> $variables) : string
Parameters
- $template : string
- $variables : array<string|int, mixed>
Return values
stringsetLocale()
Set locale (e.g.: 'fr_FR').
public
setLocale(string $locale) : void
Parameters
- $locale : string