Results 1 to 4 of 4

Thread: quickstart with modular directory structure

  1. #1
    vincelee888 is offline Junior Member
    Join Date
    Feb 2009
    Posts
    2

    Default quickstart with modular directory structure

    hi all

    i am trying to set up the guestbook found in the quickstart guide, but on a modular directory structure.

    i have gotten stuck when trying to load my form in:

    http://adlab.vincelee.net/guestbook/sign

    the signAction() function is in application/modules/guestbook/controllers/IndexController.php

    i am guessing I need to do something with routing - but am a bit lost...




    cheers!
    Last edited by vincelee888; 02-04-2009 at 10:36 AM.

  2. #2
    Eugen is offline Senior Member
    Join Date
    Sep 2008
    Location
    Croatia
    Posts
    400

    Default

    in bootstrap you need to add include path to ../application/modules/guestbook/models and add controller directory to front controller
    [PHP]$frontcontroller->addControllerDirectory('path_to_application_dir/modules/default/controllers', 'default');
    $frontcontroller->addControllerDirectory('path_to_application_dir/modules/guestbook/controllers', 'guestbook');[/PHP]

  3. #3
    vincelee888 is offline Junior Member
    Join Date
    Feb 2009
    Posts
    2

    Default

    hi

    throws the error:
    Call to a member function addControllerDirectory() on a non-object


    my bootstrap before the addcontrollerdirectory was added:

    [PHP]
    <?php

    defined('APPLICATION_PATH')
    or define('APPLICATION_PATH', dirname(__FILE__));

    defined('APPLICATION_ENVIRONMENT')
    or define('APPLICATION_ENVIRONMENT', 'development');

    $frontController = Zend_Controller_Front::getInstance();

    $frontController->addModuleDirectory(APPLICATION_PATH . '/modules/');
    $frontController->setDefaultModule('index');


    $frontController->setParam('env', APPLICATION_ENVIRONMENT);

    Zend_Layout::startMvc(APPLICATION_PATH . '/layouts/scripts');

    $view = Zend_Layout::getMvcInstance()->getView();
    $view->doctype('XHTML1_STRICT');

    $configuration = new Zend_Config_Ini(
    APPLICATION_PATH . '/config/app.ini',
    APPLICATION_ENVIRONMENT
    );

    $dbAdapter = Zend_Db::factory($configuration->database);

    Zend_Db_Table_Abstract::setDefaultAdapter($dbAdapt er);

    $registry = Zend_Registry::getInstance();
    $registry->configuration = $configuration;
    $registry->dbAdapter = $dbAdapter;

    unset($frontController, $view, $configuration, $registry);

    [/PHP]

  4. #4
    Eugen is offline Senior Member
    Join Date
    Sep 2008
    Location
    Croatia
    Posts
    400

    Default

    [PHP]$frontController->addControllerDirectory(APPLICATION_PATH . '/modules/guestbook/controllers', 'guestbook');[/PHP]

    you need to watch for uppercases

Similar Threads

  1. Modular structure
    By torin in forum Model-View-Controller (MVC)
    Replies: 4
    Last Post: 02-04-2010, 04:27 PM
  2. Zend_Translate & modular directory structure
    By ignace in forum Internationalization (i18n) & Localization (l10n)
    Replies: 1
    Last Post: 07-19-2009, 08:45 PM
  3. Modular Structure AND Models
    By risoknop in forum Databases
    Replies: 1
    Last Post: 02-25-2009, 11:57 PM
  4. directory structure vs root directory
    By TheZend in forum Installation & Configuration
    Replies: 1
    Last Post: 07-11-2008, 05:08 PM
  5. access control & translations used in a modular directory structure
    By ignace in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 01-30-2008, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •