tomaj/nette-auto-variable-template

Auto variable template factory

2.2.0 2021-11-12 09:15 UTC

This package is not auto-updated.

Last update: 2024-04-27 15:53:01 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}