Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As of March '09 the ZF thought leaders still seem to be debating the best ways to organize everything. There is a <a href="http://devzone.zend.com/article/3811-Using-Zend%5FTool-to-start-up-your-ZF-Project" rel="nofollow noreferrer">scaffolding-generator as a part of Zend_Tool</a> slated for release in ZF v1.8. It's currently in the incubator, I tried it last week and it works, but there are not many components generated in its current state.</p> <p>From the examples I've seen it seems that they are best managed separate from the models they interact with (this is from Zend Framework In Action):</p> <pre><code>/application /modules/ /default /controllers /forms ContactForm.php LoginForm.php RegisterForm.php SupportForm.php /models Comment.php User.php Users.php /views /admin /controllers /views </code></pre> <p>However, I've also seen structured with the forms below the model directory. Matthew Weier O'Phinney shows how to <a href="http://weierophinney.net/matthew/archives/200-Using-Zend_Form-in-Your-Models.html" rel="nofollow noreferrer">use them for validation on models</a> themselves:</p> <pre><code>/application /modules/ /default /controllers /models Comment.php User.php /Form Comment.php Login.php Register.php /views /admin /controllers /views </code></pre> <p>To have your files automatically included be sure to name your classes using the underscore model.</p> <p>For example, when Zend_Loader sees</p> <pre><code> class RegisterController extends Zend_Controller_Action </code></pre> <p>It looks in the php include_path for:</p> <pre><code>Zend/Controller/Action.php </code></pre> <p>Similarly, assuming the first structure above, if we include the 'default' module in our include_path:</p> <pre><code># bootstrap.php $rootDir = dirname(dirname(__FILE__)); define('ROOT_DIR', $rootDir); set_include_path(get_include_path() . PATH_SEPARATOR . ROOT_DIR . '/library/' . PATH_SEPARATOR . ROOT_DIR . '/application/modules/default/' ); include 'Zend/Loader.php'; Zend_Loader::registerAutoload(); </code></pre> <p>You name your classes:</p> <pre><code>Forms_ContactForm Models_User </code></pre> <p>Some programmers choose to put most of their files in the library so they don't have to add extra include paths:</p> <pre><code>/library /My /Form Contact.php </code></pre> <p>Assuming the library folder is included, the class above would be named:</p> <pre><code>My_Form_Contact </code></pre> <p>Best of luck! -Matt</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload