Is there a way to set default syntax to {{}} (double)

romal
Member | 9
+
0
-

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
Generous Backer | 7166
+
0
-

Try this

	$latte->onCompile[] = function ($latte) {
		$latte->getParser()->defaultSyntax = 'double';
	};
romal
Member | 9
+
0
-

I am using web-project application skeleton. Where to put the this code?

David Grudl
Generous Backer | 7166
+
0
-

In this case you can use templatePrepareFilters:

final class HomepagePresenter extends Presenter
{
	public function templatePrepareFilters($template): void
	{
		$template->getLatte()->getParser()->defaultSyntax = 'double';
	}
}