Site Directory Structure - VIew Paths and URL's
Posted: Sun Feb 03, 2008 9:05 pm
Hi,
I am fairly new at PHP. I am a Front-End Developer who is trying to improve in the back end.
I would like some feedback on the best practice for small to mid sized sites regarding site directory structure.
I have a structure much like this suggested at the Zend website:
While I don't have any models, or controllers yet, I am more concerned about managing the many pages a site could produce. Several of the modules would have applications/functionailty associate to them and then this system seams to make sense. But other areas, especially plain old marketing pages of the public site would only logically sit in a parent directory if neccissary.
I am having trouble with understanding how to best place my views.
A more static website structure might look like this:
SOOOOOoooooo....
My question is this.
If I take the MVC approached mentioned first, it seems like my URL's will be:
http://domain.com/application/module/vi ... terest.php
Clearly I am missing something here.
In the second example it is clear my URL's would end up:
http://domain.com/section/sub-section/p ... terest.php
Obviously this would produce a nice logically presented URL.
So I am missing some key idea about the distinction of Server Side and Client Side paths.
I realize I don't make a lot of sense here,
Please help!
Thanks
I am fairly new at PHP. I am a Front-End Developer who is trying to improve in the back end.
I would like some feedback on the best practice for small to mid sized sites regarding site directory structure.
I have a structure much like this suggested at the Zend website:
Code: Select all
/application
/config (optional)
/(module 1)
/config (optional as needed)
/controllers
/models
/views
/(module 2)
/controllers
/models
/views
/(module n)
/controllers
/models
/views
/htdocs
/images
/scripts
/styles
index.php
/library
/Zend
/(other libraries)
/tmp
/sessions
/cache
/view_compiles
I am having trouble with understanding how to best place my views.
A more static website structure might look like this:
Code: Select all
/root_web_folder
/_images
/_images/content
/_images/content/content_image.jpg...etc.(photos, illustrations etc.)
/_images/layout
/_images/layout/layout_image.jpg...etc.(backgrounds, buttons etc.)
/_includes/
/_includes/all.inc.php
/_scripts
/_scripts/all.js
/_styles
/_styles/common.css
/_styles/IElte6.css
/_styles/IE7B2P.css
/main_section_one/
/main_section_one/index.php...etc.
/main_section_one/all_other_section_pages.php
/main_section_two/
/main_section_two/index.php...etc.
/main_section_one/all_other_section_pages.php
/index.php...etc.
My question is this.
If I take the MVC approached mentioned first, it seems like my URL's will be:
http://domain.com/application/module/vi ... terest.php
Clearly I am missing something here.
In the second example it is clear my URL's would end up:
http://domain.com/section/sub-section/p ... terest.php
Obviously this would produce a nice logically presented URL.
So I am missing some key idea about the distinction of Server Side and Client Side paths.
I realize I don't make a lot of sense here,
Please help!
Thanks