TwigFunctions
class TwigFunctions extends AbstractExtension
Class TwigFunctions
Properties
private Session | $session | To manage PHP Sessions. | |
private TemplateRender | $renderer | Manage the renderer. | |
private DebugTool | $debugTool | The debug tool used. | |
private Translator | $translator | The translator manager. |
Methods
TwigFunctions constructor.
Return a list of functions.
Returns data messages from flash information.
Returns the copyright content.
Returns the total execution time.
Unescape html entities.
Returns the string to camel case format.
Returns a translated string.
Check different possible locations for the file and return the corresponding URI, if it exists.
Returns the necessary html code in the header of the template, to display the debug bar.
Returns the necessary html code at the footer of the template, to display the debug bar.
Renders the component with shared data.
Returns the base url.
Details
at line 56
__construct()
TwigFunctions constructor.
at line 74
TwigFunction[]
getFunctions()
Return a list of functions.
at line 98
array|mixed
flash(array $params)
Returns data messages from flash information.
at line 118
string
copyright()
Returns the copyright content.
at line 131
string
getTotalTime(bool $inMilliseconds = true)
Returns the total execution time.
NOTE: DebugBar needs around 2-10ms for itself (depends on data tabs on it).
at line 144
string
unescape(string $value)
Unescape html entities.
at line 156
string
snakeToCamel(string $toCamel)
Returns the string to camel case format.
at line 168
string
trans(null|string $key)
Returns a translated string.
at line 181
string
getResourceUri(string $path)
Check different possible locations for the file and return the corresponding URI, if it exists.
at line 191
string
getHeader()
Returns the necessary html code in the header of the template, to display the debug bar.
at line 201
string
getFooter()
Returns the necessary html code at the footer of the template, to display the debug bar.
at line 214
string
renderComponent(string $templatePath, array $data)
Renders the component with shared data.
at line 229
string
getUrl(string $url = '')
Returns the base url.