tomaj/nette-auto-variable-template

Auto variable template factory

2.0.0 2019-04-18 14:32 UTC

This package is not auto-updated.

Last update: 2020-06-26 18:45:49 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: off}
templateFactory:
	class: Tomaj\Latte\AutoVariableTemplateFactory(@latte.templateFactory)
	setup:
		- registerVariable('variableName', @someValue)
		- registerVariable('otherVariable', 'something else')

in each template will be variables {$variableName} and {$otherVariable}