Hi guys,
i enable zend_layout in my application, there are four template files,
layout.phtml, header.phtml, index.phtml, footer.phtml ,to render.
layout.phtml is the layout template,and header.phtml and footer.phtml
rendered in layout.phtml,the code as following:

layout.phtml
--------------------------------------------------
<html>
<head>
<title>layout template</title>
<?php echo $this->headScript(); ?>
</head>
<body>

<?php echo $this->render('header.phtml'); ?>

<?php echo $this->layout()->content; ?>

<?php echo $this->render('footer.phtml'); ?>

</body>
</html>

header.phtml
-------------------------------
<html>
<head>
<?php $this->headScript()->captureStart(); ?>
// script in header
<?php $this->headScript()->captureEnd(); ?>
</head>
<body>
......
</body>
</html>

index.phtml
-------------------------------------
<html>
<head>
<?php $this->headScript()->captureStart(); ?>
// script in the index
<?php $this->headScript()->captureEnd(); ?>
</head>
<body>
.....
</body>
</html>

i capture scripts in both header.phtml and index.phtml templates,but only
scripts that captured in index.phtml be output. why,and how to solve that?

Greetings,
Jacky

Reply via email to