Jump to content

Archived

This topic is now archived and is closed to further replies.

coder_

[SOLVED] Zend Framework and file location

Recommended Posts

People, I have a problem with a zend framework and file location.

 

application/
    controllers/
    views/
        _header/
        _footer/
        scripts/
             index/
        style/
             style.css
library/
    Zend/
index.php

 

I am running this on XAMPP 1.6.6a.

Everithing is good when i do not specifiy controller and action in url.

so http://"vhost_name.localhost"/ works well, but when i specify controller and action(or just a controller)

http://"vhost_name.localhost"/login/ or

http://"vhost_name.localhost"/login/index/

 

html code is loaded and displayed on page, but css style and images are not.

So this is my index.phtml file (its just a begining of project)

<?php
require_once 'application/views/scripts/_header/header.html';
?>
<div id="main_window">
	<img src="application/views/scripts/style/images/bug_helpdesk.png" />
</div>
<?php
require_once 'application/views/scripts/_footer/footer.html';
?>

So, header and footer are displayed but image is not.

Enyone knows how to solve this problem??

 

Share this post


Link to post
Share on other sites

I have not used Zend Framwork, however shouldn't all images, stylesheets etc be placed within the public folder, not the views folder.

Share this post


Link to post
Share on other sites

i tried to put them into the public folder, but when I type controller and action into URL them i get the same thing. No css and images. And html is shown correctly.

Share this post


Link to post
Share on other sites

Come on, people! It's urgent!

 

I have been searching zend framework's docs but didnt found anything. :(

Share this post


Link to post
Share on other sites

Try a layout like this:

 

/application

/controllers

/views

/scripts

/index

/index.phtml

/library

/Zend

/public_html <-- document root

/styles

/style.css

/index.php

/.htaccess

(etc.)

 

It's better because you aren't storing things inside document root that doesn't belong there (see: http://www.phpfreaks.com/tutorial/php-security/page5)

 

Also, how have you setup the rewrites?

 

Come on, people! It's urgent!

Not for us.

Share this post


Link to post
Share on other sites

Sorry peolpe my mistake. I setup dir structure correctly and check paths to files and it works now.  :-\

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.