Closed mindyk closed 10 years ago
You cannot define "sub layouts". In fact, if you set a layout using the $this->layout()
method in a nested template it will actually overwrite the layout defined by it's parent.
Here is how I would tackle what your trying to do. In this situation aaa
is your template, index
is the layout, and bbb
is the nested template.
<!-- index -->
<?=$this->content?>
<?=$this->subcontent?>
<!-- AAA -->
<?php $this->layout('index') ?>
<?php $this->start('content') ?>
<h1>CONTENT</h1>
<?php $this->end() ?>
<?php $this->start('subcontent') ?>
<?php $this->insert('bbb') ?>
<?php $this->end() ?>
<!-- BBB -->
<h2>SUBCONTENT</h2>
@mindyk, you may be interested to know that layout stacking (or sub layouts) are now possible in dev-master
, coming soon to Plates version 2.0. See issue #10 for more details.
is this possible / intented, i am trying right now and get a blank page without erros )- :
expected output