Latte standalone 2.4 default layout workaround not working

2 years ago

tpr
Member | 55
+
0
-

After updating to Latte 2.4 this workaround doesn't work anymore:
https://forum.nette.org/…2-0-released

Any clue how to fix this? Thanks!

2 years ago

David Grudl
Nette Core | 6787
+
+5
-

There is official way in 2.4:

$latte->addProvider('coreParentFinder', function ($template) {
    if (!$template->getReferenceType()) { // is not referenced, i.e. not included, is not layout itself, …
        return 'layout.latte';
    }
});

2 years ago

tpr
Member | 55
+
+1
-

Great, thanks! Loving Latte :)