Reputation: 15118
I am using zend framework.
My structure is (only included files and folders needed for this question):
application
>configs
>controllers
>forms
>images
>layouts
>scripts
>layout.phtml
>models
>styles
>style.css
>views
>scripts
>index
>index.phtml
Bootstrap.php
docs
library
logs
public
test
I have got the layout working properly. However, I want to ask a couple of questions in order to get my set up perfect for the way I want it.
application>style
s a good place for the stylesheet to be? If not what's the recommended?<title>Text</title>
. How do I pass values from my controllers to it?Upvotes: 1
Views: 109
Reputation: 2021
Stylesheets need to be accessible from the browser, so typically you will put these somewhere in the public directory, such as public/css
There are several ways, including placing rel tags in your view/layout, but my preferred option is to use the viewHelper
within your controller:
$this->view->headLink()->setStylesheet('/css/style.css');
Then your call to headLink()
in the layout file will automatically include the stylesheet.
The way I have done this is to use the Zend_Registry in the past. There may be better ways.
Upvotes: 1