Download the PHP package mangoweb/latte-bundle without Composer
On this page you can find all versions of the php package mangoweb/latte-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mangoweb/latte-bundle
More information about mangoweb/latte-bundle
Files in mangoweb/latte-bundle
Package latte-bundle
Short Description Latte templating engine for Symfony
License MIT
Informations about the package latte-bundle
Latte for Symfony
How to install
- Just install it as standard symfony bundle
- Then just ask for
Latte\Engineservice
Latte
Symfony specific macros
renderRoute
Makes a request to the given route and prints the result.
Spec
Example
routePath
Print the relative URL (without the scheme and host) for the given route.
Spec
Example
routeUrl
Print the absolute URL (with scheme and host) for the given route.
Spec
Example
relativePath
Returns the relative path from the passed absolute URL. See Symfony doc - relative_path
Spec
Example
absoluteUrl
Returns the absolute URL from the passed relative path.
Spec
Example
csrfToken
Renders a CSRF token. Use this function if you want CSRF protection without creating a form.
Spec
logoutUrl - logoutPath
Generates a absolute/relative logout URL for the given firewall. If no key is provided, the URL is generated for the current firewall the user is logged into.
Spec
Symfony filters
translate
See Symfony docs - translation in templates
Spec
domain- string, optionallocale- string, optional
Example
translateChoice
See Symfony docs - translation in templates
Spec
count- int, requireddomain- string, optionallocale- string, optional
Example
How to expand
Macros
Simple macro
- Class https://latte.nette.org/en/#toc-user-defined-macros)
- Extend class and mark service with service tag
- { name: latte.simple_macro } - Or Implement
\Mangoweb\LatteBundle\Macro\ISimpleMacroProviderand mark it with service tag- { name: latte.simple_macro_provider }
Advanced macro
- Implement directly
\Latte\IMacro - Register service and mark it with service tag
- { name: latte.advanced_macro, macro_name: fooBar }
Filters
Filter provider
- Implement
\Mangoweb\LatteBundle\Filter\IFilterProvider - Mark service with service tags:
{name: 'latte.filter_provider'}
Providers
- Create service and tag it with
- {name: 'latte.provider', provider_name: fooBar } - This will then be avabile at runtime in latte via
$this->global->fooBar
All versions of latte-bundle with dependencies
nette/forms Version ^3.0
nette/utils Version ^3.0
latte/latte Version ^2.5
symfony/framework-bundle Version ^4.1|^5.0
symfony/http-kernel Version ^4.1|^5.0