head style problem

3 messages Options
Embed this post
Permalink
Brandon Peacey

head style problem

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hello

 

I’m having a problem with headStyle method; every time I try to prepend a style ( or append a style for that matter ) it will comment out my style sheet directory. Here is an example.

 

$view->headStyle()->prependStyle(‘public/styles/main.css’)

 

Output:

 

<style type="text/css" media="screen">
<!--
public/styles/main.css
-->
</style>

 

Can anyone explain to me why this behavior is occurring?

Thank you for your time.

keith Pope-4

Re: head style problem

Reply Threaded More More options
Print post
Permalink
you are using the wrong method use headLink instead, headStyle is used
for inline styles.

Heres what I use:

// set css links and a special import for the accessibility styles
        $this->_view->headStyle()->setStyle('@import "/css/access.css";');
        $this->_view->headLink()->appendStylesheet('/css/reset.css');

2008/11/29 Brandon Peacey <[hidden email]>:

> Hello
>
>
>
> I'm having a problem with headStyle method; every time I try to prepend a
> style ( or append a style for that matter ) it will comment out my style
> sheet directory. Here is an example.
>
>
>
> $view->headStyle()->prependStyle('public/styles/main.css')
>
>
>
> Output:
>
>
>
> <style type="text/css" media="screen">
>
> <!--
>
> public/styles/main.css
>
> -->
>
> </style>
>
>
>
> Can anyone explain to me why this behavior is occurring?
>
> Thank you for your time.



--
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------
gerardroche

Re: head style problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by Brandon Peacey
Hi, I think what you're looking for is headLink(), http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.headlink

In the reference guide:

"Use HeadLink to link CSS files

HeadLink should be used to create <link> elements for including external stylesheets. HeadScript is used when you wish to define your stylesheets inline. " - http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.headstyle:



---- update ---

there's actually typo in the above

from the above:

.... external stylesheets. HeadSCRIPT is used when ...

should be headStyle?




Brandon Peacey wrote:
Hello

I'm having a problem with headStyle method; every time I try to prepend a
style ( or append a style for that matter ) it will comment out my style
sheet directory. Here is an example.

 

$view->headStyle()->prependStyle('public/styles/main.css')

 

Output:

 

<style type="text/css" media="screen">
<!--
public/styles/main.css
-->
</style>

 

Can anyone explain to me why this behavior is occurring?

Thank you for your time.