Author Topic: [SOLVED] Zend Framework and file location  (Read 1506 times)

0 Members and 1 Guest are viewing this topic.

Offline coder_Topic starter

  • Enthusiast
  • Posts: 65
  • Gender: Male
  • I will be developer in the next life too.
    • View Profile
[SOLVED] Zend Framework and file location
« on: August 01, 2008, 08:54:45 AM »
People, I have a problem with a zend framework and file location.

Code: [Select]
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)
Code: [Select]
<?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??
RTFM!

Offline coder_Topic starter

  • Enthusiast
  • Posts: 65
  • Gender: Male
  • I will be developer in the next life too.
    • View Profile
Re: Zend Framework and file location
« Reply #1 on: August 01, 2008, 12:34:12 PM »
So nobody can help me??
RTFM!

Offline wildteen88

  • Guru
  • 'Insane!'
  • *
  • Posts: 12,021
  • Gender: Male
    • View Profile
Re: Zend Framework and file location
« Reply #2 on: August 01, 2008, 12:41:27 PM »
I have not used Zend Framwork, however shouldn't all images, stylesheets etc be placed within the public folder, not the views folder.

Offline coder_Topic starter

  • Enthusiast
  • Posts: 65
  • Gender: Male
  • I will be developer in the next life too.
    • View Profile
Re: Zend Framework and file location
« Reply #3 on: August 01, 2008, 12:43:56 PM »
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.
RTFM!

Offline coder_Topic starter

  • Enthusiast
  • Posts: 65
  • Gender: Male
  • I will be developer in the next life too.
    • View Profile
Re: Zend Framework and file location
« Reply #4 on: August 01, 2008, 03:55:16 PM »
Come on, people! It's urgent!

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

Offline Daniel0

  • Administrator
  • 'Insane!'
  • *
  • Posts: 11,815
  • Gender: Male
  • ^bb|[^b]{2}$
    • View Profile
Re: Zend Framework and file location
« Reply #5 on: August 01, 2008, 05:39:48 PM »
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.
« Last Edit: August 01, 2008, 05:40:55 PM by Daniel0 »

Offline coder_Topic starter

  • Enthusiast
  • Posts: 65
  • Gender: Male
  • I will be developer in the next life too.
    • View Profile
Re: Zend Framework and file location
« Reply #6 on: August 01, 2008, 09:11:31 PM »
Sorry peolpe my mistake. I setup dir structure correctly and check paths to files and it works now.  :-\
RTFM!