Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6042831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:50:00+00:00 2026-05-23T06:50:00+00:00

Using PHP 5.3 and Zend Framework 1.11.7 I’ve been trying to configure the AutoLoader

  • 0

Using PHP 5.3 and Zend Framework 1.11.7 I’ve been trying to configure the AutoLoader to auto load my Model classes (for Zend_Db) that resides in the default directory application/models.

I found the following solution:

I can add the following function to the Bootstrap.php:

protected function _initLoader() 
{
    $loader = new Zend_Loader_Autoloader_Resource (array (
    'basePath' => APPLICATION_PATH,
    'namespace' => 'Default'));
    $loader -> addResourceType ( 'model', 'models', 'Model'); 
}  

it seems like an option that should be easily set in application.ini. so my question is, are there any relevant directives that I can add to application.ini that perform the same task my function performs ?

update

after setting the appnamespace directive, i still need to add the following function:

protected function _initLoader() 
{    
    $loader = new Zend_Loader_Autoloader_Resource (array (
    'basePath' => APPLICATION_PATH));
    $loader -> addResourceType ( 'model', 'models', 'Model'); 
}

or else it won’t find my model classes.

the only difference is that I removed the attribute ‘namespace’.

any other attributes i can add to remove this function entirely ?

thank you! 🙂

Kfir

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:50:00+00:00Added an answer on May 23, 2026 at 6:50 am

    In your application.ini you should have set

    appnamespace = "Application"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    

    The appnamespace is the prefix you use for your models so if your model is “Default_Model_User” then the appnamespace will be ‘Default’, if your model is “Application_Model_User” then the appnamespace will be “application”

    These two directives should sort out your autoloading for the default application

    You can also set it in your bootstrap with, you need to use the Zend_Application_Module_AutoLoader:

    protected function _initDefaultModuleAutoloader()
    {
        $this->_resourceLoader = new Zend_Application_Module_Autoloader(array(
            'namespace' => 'Application',
            'basePath'  => APPLICATION_PATH,
        ));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In using PHP's DOM classes (DOMNode, DOMEElement, etc) I have noticed that they possess
Trying to get a simple PHP/Zend Framework setup to create a SQLite databse and
I've built a search index using the PHP Zend Framework Search (based on Lucene).
I would like to build a cms with php using zend framework. I have
I am working on a huge php application with Zend framework, in that project
I am currently working on a big management system (in PHP using Zend Framework,
I'm using Zend Studio to do remote debugging of my php scripts on a
Using PHP and MySQL, I have a forum system I'm trying to build. What
Been using PHP/MySQL for a little while now, and I'm wondering if there are
I've been using PHP & MySQL for ages and am about to start using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.