ViewInterface
in
View interface
Table of Contents
Methods
- addGlobal() : void
- Add global variable
- createComponent() : ComponentInterface
- Create component
- fetch() : string|null
- Render template
- fetchBlock() : string|null
- Render template block
- fetchFromString() : string
- Render template from string
- getCache() : CacheInterface
- Get cache
- getCurrentExtension() : ExtensionInterface
- Get current extension
- getEnvironment() : Environment
- Get Twig environment
- getExtension() : ExtensionInterface
- Get twig extension
- getExtensionsPath() : string
- Gte extensions path
- getGlobals() : array<string|int, mixed>
- Get all global vars
- getPrimaryTemplate() : string
- Get primary template
- getService() : mixed|null
- Get service
- getTemplatesPath() : string
- Get templates path
- getViewPath() : string
- Get view path
- renderComponent() : HtmlComponentInterface
- Render html component
- setPrimaryTemplate() : void
- Set primary template
Methods
addGlobal()
Add global variable
public
addGlobal(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
createComponent()
Create component
public
createComponent(string $name, string $language, string $type[, int|null $renderMode = null ][, array<string|int, mixed> $parent = [] ]) : ComponentInterface
Parameters
- $name : string
- $language : string
- $type : string
- $renderMode : int|null = null
- $parent : array<string|int, mixed> = []
Return values
ComponentInterfacefetch()
Render template
public
fetch(string $template[, array<string|int, mixed> $params = [] ]) : string|null
Parameters
- $template : string
- $params : array<string|int, mixed> = []
Return values
string|nullfetchBlock()
Render template block
public
fetchBlock(string $template, string $block[, array<string|int, mixed> $params = [] ]) : string|null
Parameters
- $template : string
- $block : string
- $params : array<string|int, mixed> = []
Return values
string|nullfetchFromString()
Render template from string
public
fetchFromString(string $string[, array<string|int, mixed> $params = [] ]) : string
Parameters
- $string : string
- $params : array<string|int, mixed> = []
Return values
stringgetCache()
Get cache
public
getCache() : CacheInterface
Return values
CacheInterfacegetCurrentExtension()
Get current extension
public
getCurrentExtension() : ExtensionInterface
Return values
ExtensionInterfacegetEnvironment()
Get Twig environment
public
getEnvironment() : Environment
Return values
EnvironmentgetExtension()
Get twig extension
public
getExtension(string $class) : ExtensionInterface
Parameters
- $class : string
Return values
ExtensionInterfacegetExtensionsPath()
Gte extensions path
public
getExtensionsPath() : string
Return values
stringgetGlobals()
Get all global vars
public
getGlobals() : array<string|int, mixed>
Return values
array<string|int, mixed>getPrimaryTemplate()
Get primary template
public
getPrimaryTemplate() : string
Return values
stringgetService()
Get service
public
getService(string $name) : mixed|null
Parameters
- $name : string
Return values
mixed|nullgetTemplatesPath()
Get templates path
public
getTemplatesPath() : string
Return values
stringgetViewPath()
Get view path
public
getViewPath() : string
Return values
stringrenderComponent()
Render html component
public
renderComponent(string $name, string $language[, array<string|int, mixed>|null $params = [] ][, string|null $type = null ][, int|null $mode = null ][, array<string|int, mixed> $parent = [] ]) : HtmlComponentInterface
Parameters
- $name : string
- $language : string
- $params : array<string|int, mixed>|null = []
- $type : string|null = null
- $mode : int|null = null
- $parent : array<string|int, mixed> = []
Return values
HtmlComponentInterfacesetPrimaryTemplate()
Set primary template
public
setPrimaryTemplate(string $templateName) : void
Parameters
- $templateName : string