Skip to end of metadata
Go to start of metadata

<h1>Full Directory Tree's (all possible directories) / Layouts By Name</h1>

<p>Intro. The aim of this document is to demonstrate and name the types of layouts that are commonly found in dynamic web applications. While these do not specifically serve as the "end-all-be-all", they are indeed a guide. </p>

<p>This guide aims to:</p>
<ul>
<li>Aid developers in starting a new project.</li>
<li>Explain the pros and cons associated with a given layout.</li>
<li>PseudoStandardize the <em>approach</em> of determining a layout.</li>
<li>Give developers a resource and guide when talking about their layout with other developers.</li>
</ul>

<h2>Classical</h2>

<p>Initially broken down into two main directories, web-readable and application files. The application directory mimics the *nix layout style of application development. This style would be prefered by someone who favors the unix application/os layout. Pros include self containment, logical orgainization, local (not server wide) library files, and is good for applications whos models, views and controllers are typically interrelated. Cons include a 'techy' naming convention which is indiginous to the *nix style, lumps all models, views and controllers together (if they are not-interrelated.. think the code overlap between an sites blog application and a voting module).</p>

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
/application
/etc
/lib
/Zend
/[OTHER]
/usr
/controllers
/models
/views
/var
/sessions
/cache
/view_compiles
/httpdocs
/img
/scripts
/styles
]]></ac:plain-text-body></ac:macro>

<h2>Classical Extended</h2>

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
/application
/config
/library
/Zend
/[OTHER]
/user
/controller
/model
/view
/variable
/sessions
/cache
/view_compiles
/httpdocs
/img
/scripts
/styles
index.php
]]></ac:plain-text-body></ac:macro>

<h2>Conventional</h2>

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
/application
/controllers
/models
/views
/httpdocs
/img
/scripts
/styles
index.php
/library
/Zend
/[OTHER]
/tmp
/sessions
/cache
/view_compiles
]]></ac:plain-text-body></ac:macro>

<h2>Conventional Modular</h2>

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
/application
/[module1]
/controllers
/models
/views
/[module2]
/controllers
/models
/views
/[moduleX]
/controllers
/models
/views
/httpdocs
/img
/scripts
/styles
index.php
/library
/Zend
/[OTHER]
/tmp
/sessions
/cache
/view_compiles

]]></ac:plain-text-body></ac:macro>

<h2>Classical Extended Embedded</h2>

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
/httpdocs
/application
/config
/library
/Zend
/[OTHER]
/user
/controller
/model
/view
/variable
/sessions
/cache
/view_compiles
.htaccess (deny from all)
/img
/scripts
/styles
index.php
]]></ac:plain-text-body></ac:macro>

<p><span style="text-decoration: underline;">Modular Suffix</span> - When models,views and controller for a specific application module are grouped into logical 'packages', or directories.</p>

<p><span style="text-decoration: underline;">Extended Suffix</span> - More human readable naming conventions, typically but not limited to the following:</p>
<blockquote><p>etc => config</p></blockquote>
<blockquote><p>lib => library</p></blockquote>
<blockquote><p>usr => user</p></blockquote>
<blockquote><p>var => variable</p></blockquote>

<p><span style="text-decoration: underline;">Embedded Suffix</span> - In certian environments, moving the application-related files outside the web-readable directory might not be an option, in this case, the files are in the web readable directory and MUST BE protected via a .htaccess file, or some other related protection mechanism. Also note, that the route /application/ would not be available due to it existing in the file system</p>

<p><span style="text-decoration: underline;">Httpdocs</span> - Other acceptable names for the web readable directory may include: <em>htdocs</em> or <em>public_html</em></p>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Dec 06, 2006

    <p>Ralph,</p>

    <p>Please see the updated document at <a class="external-link" href="http://framework.zend.com/wiki/display/ZFUSER/Directory+Layout+Examples+for+MVC+Applications">http://framework.zend.com/wiki/display/ZFUSER/Directory+Layout+Examples+for+MVC+Applications</a></p>