PhpTemplate
in package
The PhpTemplate Engine.
Table of Contents
Properties
- $assets : array<string|int, mixed>
- A structured array of assets.
- $theme : string
- The Name of the theme.
- $themePath : string
- The path to the theme.
Methods
- build() : string
- Do the heavy lifting of parsing the tpl.php files.
- getPageScripts() : string
- Get the inline aggregated scripts.
- getPageStyles() : string
- Get the inline aggregated styles.
- render() : void
- Prints the render array after it gets parsed into html by build.
- useTheme() : void
- Sets the theme that is to be used by the renderer.
Properties
$assets
A structured array of assets.
protected
array<string|int, mixed>
$assets
= ["js" => [], "css" => []]
$theme
The Name of the theme.
protected
string
$theme
$themePath
The path to the theme.
protected
string
$themePath
Methods
build()
Do the heavy lifting of parsing the tpl.php files.
public
build(array<string|int, mixed> $build) : string
Execute the tpl.php files and and give them correct variable contexts.
Parameters
- $build : array<string|int, mixed>
Return values
stringgetPageScripts()
Get the inline aggregated scripts.
public
getPageScripts() : string
Return values
stringgetPageStyles()
Get the inline aggregated styles.
public
getPageStyles() : string
Return values
stringrender()
Prints the render array after it gets parsed into html by build.
public
render(array<string|int, mixed> $build) : void
Parameters
- $build : array<string|int, mixed>
useTheme()
Sets the theme that is to be used by the renderer.
public
useTheme(string $theme[, string|null $theme_path = NULL ]) : void
Parameters
- $theme : string
- $theme_path : string|null = NULL