There is a Latte\Engine instance in the presenter available in $this->template , so all you have to do is register the filter as follows:
<?php abstract class BasePresenter extends Nette\Application\UI\Presenter { public function beforeRender() {
Publish the example using BasePresenter , which is the parent of all other presenters, but you can only register it in the presenter you want and speed up your application.
source share