What you are doing has worked for me in the past, which version of ZF are
you using?

Also, unless I'm missing something, there is no real need for your layout
script to be adding CSS to headLink() when it can output the <link> tag
itself:

<head>
<link rel="stylesheet" href="<?= $this->basUrl() . '/c/css/loader.css' ?>"
/>
<?= $this->headLink() ?>
</head>

I found it much easier to hand-code the base <LINK/> (and <SCRIPT/>) tags in
the layout so I wouldn't have to deal with multiple calls in reverse order
to prependStylesheet().

--
Hector


On Sun, Jan 24, 2010 at 4:42 AM, gelform <[email protected]> wrote:

>
> I've got this in my layout script:
> <?php
> $this->headLink()->prependStylesheet($this->baseUrl().'/c/css/loader.css');
> ?>
> <?php echo $this->headLink(); ?>
>
> And in my controller I want to append a page-specific stylesheet:
> $this->view->headLink()->appendStylesheet('/c/css/homepage.css');
>
> Which I would think would result in loader (prepend), and then homepage
> (append):
> <link href="/c/css/loader.css" media="screen" rel="stylesheet"
> type="text/css" >
> <link href="/c/css/homepage.css" media="screen" rel="stylesheet"
> type="text/css" >
>
> But instead, it reverses the order:
> <link href="/c/css/homepage.css" media="screen" rel="stylesheet"
> type="text/css" >
> <link href="/c/css/loader.css" media="screen" rel="stylesheet"
> type="text/css" >
>
> I've tried every combination of prepend and append, and I think I'm not
> understanding the order they get written to the page. Any help? Thanks.
>
> --
> View this message in context:
> http://n4.nabble.com/headlink-append-seems-to-prepend-tp1288635p1288635.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to