Is there a way to set default syntax to {{}} (double)
- romal
- Member | 16
So, we have syntax
switching.
But, is there a way to set default syntax mode to {{}} (double)
May be there is some configuration option that enables not to write {syntax
double} in each template?
- David Grudl
- Nette Core | 8218
Try this
$latte->onCompile[] = function ($latte) {
$latte->getParser()->defaultSyntax = 'double';
};
- David Grudl
- Nette Core | 8218
In this case you can use templatePrepareFilters
:
final class HomepagePresenter extends Presenter
{
public function templatePrepareFilters($template): void
{
$template->getLatte()->getParser()->defaultSyntax = 'double';
}
}