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

  • SEARCH
  • Home
  • 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

I am trying to build a Connect app using PHP and the Zend Framework.
I'm trying to create a Zend Framework project using PHP 5.3.2 and Zend Framework
I am trying to read some settings from php.ini using zend. The API that
I've been programming a site using: Zend Framework 1.11.5 (complete MVC) PHP 5.3.6 Apache
I've built a search index using the PHP Zend Framework Search (based on Lucene).
I have a PHP MVC application using Zend Framework. As presented in the quickstart,
All, I have a PHP Web application built using Zend Framework and MVC with
I am trying to include the Zend_Service_Amazon_S3 file by using require_once 'Zend/Service/Amazon/S3.php'; I have
We are running a PHP (zend framework) app that creates a database per user
I want to write a php application using Zend Framework 2 (just the beta

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.