tomaj / nette-auto-variable-template
Auto variable template factory
Installs: 96 723
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: >= 7.1.0
- nette/application: ^3.0
- nette/utils: ^3.0
This package is not auto-updated.
Last update: 2024-10-26 19:16:00 UTC
README
Simple library that can assign variables in all latte templates (also components). Usefull when you need variable that will be always in all templates.
Instalation
composer require "tomaj/nette-auto-variable-template"
Usage
In config.neon you need setup factory:
latte.templateFactory: {autowired: no}
templateFactory:
factory: Tomaj\Latte\AutoVariableTemplateFactory(@latte.templateFactory)
setup:
- registerVariable('variableName', @someValue)
- registerVariable('otherVariable', 'something else')
in each template will be variables {$variableName} and {$otherVariable}