+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13

Thread: 1.8.0 Bootstrapping Modules and Autoloaders

  1. #11
    viatkine is offline Junior Member
    Join Date
    Jun 2009
    Posts
    1

    Default

    Quote Originally Posted by alokin View Post
    Hi,
    But when I try to use, for example Admin_Form_NewCategory, I get error Class Admin_Form_NewCategory not found...

    What should I do?
    You have to create extra bootstraps for each your module.
    For example:
    [PHP]
    //application/modules/admin/Bootstrap.php
    class Admin_Boostrap extends Zend_Application_Module_Bootstrap
    {
    //can be empty
    }[/PHP]

    Then your Admin_Form_NewCategory will work.

    For more info, look there: Modular applications in ZF 1.8 mzBlog

  2. #12
    mouse is offline Junior Member
    Join Date
    Oct 2009
    Posts
    1

    Default

    Quote: Posted by leigh_m


    Did you put the following in your application.ini:

    resources.modules = ""

    This worked for me.

    I tried that before and it bombed out with some error. I'll try again tonight though.
    I too was struggling with this and I put the issue aside to deal with other problems. Then I started implementing Module-level ini configurations following this post :

    Zend Framework: module config | vandenbos.org

    and discovered the solution to getting Module-level Bootstrap files to actually load.

    The answer to the problem is not in any of the documentation I have read regarding Module implemention in Zend Framework. But all you need to do is to add 'resources.modules[] = ' to your application.ini file. This line will then enable the loading of your module Bootstrap.php files.

    Remember to name the module-level Bootstrap class after your module. eg.
    'class Admin_Bootstrap extends Zend_Application_Module_Bootstrap' or you will get an error about 'Cannot redeclare class Bootstrap'.

    Hope this helps.

  3. #13
    m4niac's Avatar
    m4niac is offline Junior Member
    Join Date
    Oct 2009
    Posts
    8

    Default

    Quote Originally Posted by leigh_m View Post
    Alright! I got it working. After lots of screwing around and trial and error I decided to completely scrap everything and start again with all the tips and I read about and all the various things I learnt in my mistakes.

    In the end this is how it all looks.
    My Main Bootstrap
    [PHP]
    <?php

    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
    {

    protected function _initApplication()
    {
    $this->bootstrap('frontcontroller');
    $front = $this->getResource('frontcontroller');
    $front->addModuleDirectory(dirname(__FILE__) . '/modules');
    }

    protected function _initDoctype()
    {
    $this->bootstrap('view');
    $view = $this->getResource('view');
    $view->doctype('XHTML1_STRICT');
    }
    }
    [/PHP]

    My config file
    damn im stupid :| instead of carefully reading your solving thread i have searched the whole day long for a solution to my problem... instead of resources.modules = '' i was using (as Jeroen and other guys say) resources.modules[] = and i just couldnt figure out why the heck wasn't working :|

    has it anything to do with zf's version? even though Jeroen's tutorial seems pretty up to date :| can someone explain to me, please, why for some

    resources.modules[] = works and for others (like me) works this way:

    resources.modules = ''

    ? thanks in advance

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Bootstrapping configurationless application resource
    By carolx0 in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 06-11-2010, 01:05 PM
  2. Opcode (APC/XCache), Zend, Doctrine, and Autoloaders
    By Cindy in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 09-01-2009, 05:37 PM
  3. Modules, Forms, and Maybe Bootstrapping
    By Bateman in forum General Q&A on Zend Framework
    Replies: 3
    Last Post: 07-28-2009, 11:46 PM
  4. Strange bootstrapping problem
    By Sh4wn in forum General Q&A on Zend Framework
    Replies: 3
    Last Post: 06-30-2009, 11:01 AM
  5. Bootstrapping, the ZF 1.8 way
    By Regx in forum Resources for Developers
    Replies: 8
    Last Post: 06-29-2009, 09:58 AM

Posting Permissions

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