I started using Zend Framework and tried to add some stylesheets and javascript files like this in my layout.phtml:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LoremIpsum</title>
<?php echo $this->headLink()->appendStylesheet('css/global.css'); ?>
</head>
The problem with this is, that it is only working if there is no action specified in the url.
For example it works with this:
http://www.domain.com, http://www.domain.com/index, http://www.domain.com/login
but if I add the action, even if it is
http://www.domain.com/index/index
it stops working.
I noticed that in this case the index.php is called twice and calls the ErrorController.
But the output shows no error. It is the expected output just without the stylesheet information.
Any ideas what is wrong with my layout?
Edit 1:
Error Reporting is activated and works in other cases.
HTML markup is correct.
Firebug show that my css file wasn’t found, but the path can’t be wrong because without specified action it works correctly.
You can use the BaseUrl() View helper:
Then it should be fine…