Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to apply conditional stylesheet $this->headLink()->appendStylesheet('css/css.css') with zend-framework

can anyone help me with what to do for css for IE (for blueprint css)

I have done

<?php $headlink = $this->headLink();        
    $headlink->appendStylesheet($this->baseUrl('css/blueprint/screen.css') , 'screen, projection')
        ->appendStylesheet($this->baseUrl('css/blueprint/ie.css'), 'screen, projection', "IE")
        ->appendStylesheet($this->baseUrl('css/blueprint/print.css'));
    echo $headlink;
?>

and this code didn't work either

<?php $headlink = $this->headLink();        
    $headlink->appendStylesheet($this->baseUrl('css/blueprint/screen.css') , 'screen, projection')
        ->appendStylesheet($this->baseUrl('css/blueprint/ie.css'), 'screen, projection', true)
        ->appendStylesheet($this->baseUrl('css/blueprint/print.css'));
    echo $headlink;
?>

UPDATES::

it shoudl look like

<!--[if lt IE 8]><link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
like image 969
Santosh Linkha Avatar asked Jan 17 '11 09:01

Santosh Linkha


2 Answers

$this->view->headLink()->appendStylesheet('/css/ie.css', 'screen', 'IE');
$this->view->headLink()->appendStylesheet('/css/ie6.css', 'screen', 'IE6'); 
like image 56
Richard Knop Avatar answered Oct 30 '22 04:10

Richard Knop


Is this what you mean

->appendStylesheet($this->baseUrl('/css/ie6.css'), "screen", 'IE 6')

The section with IE 6 in, can be any expression used for including IE specific stylesheets

Hope that helps.

like image 21
Jake N Avatar answered Oct 30 '22 04:10

Jake N