(on Monday, 08 December 2008, 02:07 AM -0800):
> I have a view helper that is used in my layout file, which (among other
> things) adds CSS to the document head using the HeadLink helper. The problem
> is that the helper is using HeadLink *after* the layout calls "echo
> $this->headLink();", so the CSS is never output.
>
> Is there no way of adding CSS to the head from within a layout file (after
> the document head)?
>
> I would have liked to have avoided CSS in the body.
Capture the return value of your view helper at the top of your layout
script, and then echo it within the body:
<? $foobar = $this->myHelper(); ?>
<?= $this->doctype() ?>
<html>
<head>
<?= $this->headTitle() ?>
<?= $this->headLink() ?>
</head>
<body>
<?= $this->layout()->content ?>
<?= $foobar ?>
</body>
--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论