JohnD Posted April 28, 2011 Report Share Posted April 28, 2011 Hi , I'm new to the Zend Framework , sorry for my dump question . I have created a project with the zf tool , my layout is archived with layout.php and CSS . Only the index.php ( index/index.php , someothercontroller/index.php etc... ) are working with the CSS . All other view's (index/otherview.php , someothercontroller/otherview.php ) are rendered without CSS . It seems that the path of the CSS file can't be found . My CSS file is in the APPLICATION_DIR/public/style.css directory . My lyaout.php file is configured as follows : < ?php echo $this->headLink()->appendStylesheet('style.css') ?> The source code on my browser shows : <html > <head> <title>Your Title</title> <link href="style.css" media="screen" rel="stylesheet" type="text/css" /> </head> My browser's CSS source code shows the same CSS path on all pages (pages that are rendered correctly and pages that don't ) I can provide more details if my question is not understandable . Thanks Quote Link to comment Share on other sites More sharing options...
JohnD Posted April 28, 2011 Author Report Share Posted April 28, 2011 Hi again , Finally , it was the definition of the path on my layout file : <?php echo $this->headLink()->appendStylesheet('http://zendtest.local/media/css/style.css'); ?> Using an absolute path solved my problem ,it works . But now ,when observing the source code of my browser when loading the page I mention that the "style link" is mentioned twice ; <link href="style.css" media="screen" rel="stylesheet" type="text/css" /> <link href="http://zendtest.local/media/css/style.css" media="screen" rel="stylesheet" type="text/css" /> I can't explain that , although my application works on my local development environment ; < ?php /* Comments : Thanks to this forum */ JohnD Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.