Jump to content

Question :Zend Framework CSS layout


JohnD

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...