cakephp / twig-view

Twig View for CakePHP
MIT License
13 stars 6 forks source link

Add layout tag for setting layout from template #67

Closed othercorey closed 3 years ago

othercorey commented 3 years ago

This allows setting the layout from view template similar to how they are done in default cake view templates. The layout is permanently set when set through the template.

Previously, you had to use a {% do ... %} work-around, but this is not very obvious since the _view global variable cannot modify protected members.

Example:

{% layout 'Error' %}