Ubiquity Twig template engine.
More...
|
| __construct ($options=[]) |
|
| addFunction (string $name, $callback, array $options=[]) |
|
| render (string $viewName, ?array $pData=[], bool $asString=false) |
| Renders a view.
|
|
| getBlockNames (string $templateName) |
| {Returns the defined block names.- Parameters
-
}
|
|
| getCode (string $templateName) |
| {Returns the source code of the template.- Parameters
-
}
|
|
| addPath (string $path, string $namespace) |
| Adds a new path in a namespace.
|
|
| setPaths (array $paths, string $namespace) |
| Sets a path in a namespace.
|
|
| setTheme (string $theme, string $themeFolder=ThemesManager::THEMES_FOLDER) |
|
| exists (string $name) |
| Checks if we have the source code of a template, given its name.
|
|
| getGenerator () |
|
| generateTemplateSourceFromFile (string $templateName) |
| Generates the source for this engine from a twig model template.
|
|
| generateTemplateSource (string $source) |
|
Ubiquity Twig template engine.
Ubiquity\views\engine$Twig This class is part of Ubiquity
- Author
- jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
- Version
- 1.0.13
Definition at line 31 of file Twig.php.
◆ __construct()
__construct |
( |
|
$options = [] | ) |
|
◆ addExtension()
addExtension |
( |
|
$extension | ) |
|
|
protected |
◆ addFilter()
addFilter |
( |
string |
$name, |
|
|
|
$callback, |
|
|
array |
$options = [] |
|
) |
| |
|
protected |
- Parameters
-
string | $name | |
| $callback | |
array | $options | |
- Returns
- void
Reimplemented from TemplateEngine.
Definition at line 88 of file Twig.php.
◆ addFunction()
addFunction |
( |
string |
$name, |
|
|
|
$callback, |
|
|
array |
$options = [] |
|
) |
| |
- Parameters
-
string | $name | |
| $callback | |
array | $options | |
- Returns
- void
Reimplemented from TemplateEngine.
Definition at line 84 of file Twig.php.
◆ addFunctions()
◆ addPath()
addPath |
( |
string |
$path, |
|
|
string |
$namespace |
|
) |
| |
Adds a new path in a namespace.
- Parameters
-
string | $path | The path to add |
string | $namespace | The namespace to use |
Definition at line 141 of file Twig.php.
◆ exists()
Checks if we have the source code of a template, given its name.
- Parameters
-
- Returns
- boolean
Reimplemented from TemplateEngine.
Definition at line 173 of file Twig.php.
◆ getBlockNames()
getBlockNames |
( |
string |
$templateName | ) |
|
{Returns the defined block names.
- Parameters
-
}
- See also
- \Ubiquity\views\engine\TemplateEngine::getBlockNames()
Reimplemented from TemplateEngine.
Definition at line 117 of file Twig.php.
◆ getCode()
getCode |
( |
string |
$templateName | ) |
|
{Returns the source code of the template.
- Parameters
-
}
- See also
- \Ubiquity\views\engine\TemplateEngine::getCode()
Reimplemented from TemplateEngine.
Definition at line 131 of file Twig.php.
◆ getGenerator()
◆ render()
render |
( |
string |
$viewName, |
|
|
?array |
$pData = [] , |
|
|
bool |
$asString = false |
|
) |
| |
Renders a view.
- Parameters
-
string | $viewName | |
array | null | $pData | |
boolean | $asString | |
Reimplemented from TemplateEngine.
Definition at line 100 of file Twig.php.
◆ setPaths()
setPaths |
( |
array |
$paths, |
|
|
string |
$namespace |
|
) |
| |
Sets a path in a namespace.
- Parameters
-
array | $paths | The paths to add |
string | $namespace | The namespace to use |
Definition at line 151 of file Twig.php.
◆ setTheme()
setTheme |
( |
string |
$theme, |
|
|
string |
$themeFolder = ThemesManager::THEMES_FOLDER |
|
) |
| |
- Parameters
-
string | $theme | |
string | $themeFolder | |
- Returns
- string|void
- Exceptions
-
Reimplemented from TemplateEngine.
Definition at line 161 of file Twig.php.
◆ $loader
◆ $twig
The documentation for this class was generated from the following file:
- C:/Users/myadd/Documents/GitHub/ubiquity-doc-api/vendor/phpmv/ubiquity/src/Ubiquity/views/engine/twig/Twig.php