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
Page 1 of 1
Question :Zend Framework CSS layout
#2
Posted 28 April 2011 - 05:04 AM
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
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
Share this topic:
Page 1 of 1

Help









