Hi,

Today i came across an issue that i couldn’t find a nice solution for. In
short it stated in the subject, placeholder view helpers like headScript()
don’t work for partials (or any custom view helpers) when in layout context.

Like in this example:

<?
    //layout phtml
    <head>
        <?=$this->headLink(); ?>
    </head>

    <body>
        <?=$this->partial('blogposts.phtml')?
    </body>

    ...

    //partial.phtml
    <?php $this->headLink()->appendStylesheet('partial.css')>
?>

So this will not work for the obvious reason - the partial is executed after
the placeholder aggregator, so anything appended in the partial view will
never get to the head.

After some research i see it’s a well-known issue that many people
encounter. 

So my question is - will this issue be addressed in the future versions?

Because all the methods like the one described in this thread:

http://www.nabble.com/Using-HeadLink-from-a-view-helper-(in-the-layout)-tt20892525.html

just seem ... well... not very ‘clean’.

Also maybe there’s a known solution that i can use in front controller
plugin (for example) that will take care of the issue, or any other approach
how this may be implemented.

Thanks in advance and good luck.
Dmitry.





-- 
View this message in context: 
http://www.nabble.com/Placeholder-view-helpers-in-partials-don%27t-work-for-layouts--tp24042045p24042045.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to