I am using zend for my project. I am having code like below inside <HEAD>,
<?= $this->headLink()
->appendStylesheet(BASE_URL . 'css/css.css')
->appendStylesheet(BASE_URL . 'css/front.css')
->appendStylesheet(BASE_URL . 'css/jquerymenu.css')
->appendStylesheet(BASE_URL . 'css/lider.css'); ?>
In my template page say list.phtml has the code like ,
<?= $this->headLink()->appendStylesheet(BASE_URL . 'css/templates/list.css'); ?>
So this append style sheet twice,
1. Inside <HEAD> tag
2. Inside that list.phtml.
How do i include only inside <HEAD> tag in zend ? or Is it possible to apply this list.css only when user open list page?
By doing this we can pass w3 validation.Kindly advice on this ?
The shorttag
<?=equals<?php echo. So in your viewtemplate just useThis will add the
list.cssand it will echoed together with the other stylesheets in your layout template when you call theheadLink().To make sure that your base CSS is the first loaded you can use
prependStylesheet().Also consider not to use shorttags, see this question for more info.