N
N
Narek2014-03-24 23:12:40
Zend Framework
Narek, 2014-03-24 23:12:40

Layouts in zf2 - how to add position for output?

In the layout file, the output of the content happens like this: echo $this->content.
And if my template is divided into header, footer, left, content blocks and I want to display each block separately in the layout file, i.e.:

<div id="main">
<header><?=$this->header?></header>
<div id="cnt">
<? echo $this->content ?>
</div>
<footer><?=$this->footer?></footer>
</div>

How can this be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-03-24
Protko @Fesor

twig .

C
cawakharkov, 2014-03-25
@cawakharkov

There is a partial framework for this.zend.com/manual/2.3/en/modules/zend.view...
<?= $this->partial('partials/header') ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question