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 8472753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:09:46+00:00 2026-06-10T17:09:46+00:00

I am really new to Zend Framework and am using it on regular Apache

  • 0

I am really new to Zend Framework and am using it on regular Apache 2 + PHP server.

I want to use my models which extend Zend_Table_Abstract. I put it in my /application/models directory but these files do not even get included (they have syntax errors but my app works just fine). What are the required actions to get them included? What should be done in Bootstrap and what naming conventions should be followed? I’ve seen people using just regular names like Users or Articles.

/application/models/Languages.php:

<?php
adasdasdadasd
echo 'hi';

class Languages extends Zend_Db_Table_Abstract {
    protected $_name = 'languages';
}

/application/controllers/LanguageController.php

<?php

class LanguagesController extends Zend_Controller_Action {
    public function indexAction() {
        $languages = new Languages();

        $this->view->languages = $languages->select();
    }
}

/application/Bootstrap.php (some code is there just because I copied it from some example or answer)

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
    protected function _initAutoload() {
        $moduleLoader = new Zend_Application_Module_Autoloader(array(
            'namespace' => '',
            'basePath' => APPLICATION_PATH)
        );

        $autoloader = Zend_Loader_Autoloader::getInstance();
        $autoloader->registerNamespace(array('Application_'));

        return $moduleLoader;
    }

    protected function _initResourceAutoloader()
    {
        $autoloader = new Zend_Loader_Autoloader_Resource(array(
            'basePath'  => APPLICATION_PATH,
            'namespace' => 'Application_',
        ));

        return $autoloader;
    }

    protected function _initFrontController()
    {
        $controller = Zend_Controller_Front::getInstance();

        $controller->setControllerDirectory(APPLICATION_PATH . '/controllers');

        if ($controller->getParam('bootstrap') === null) {
            $controller->setParam('bootstrap', $this);
        }

        return $controller;
    }

    protected function _initApplication() {
    }

    protected function _initModuleConfig()
    {
    }

    protected function _initLayout(){ 
        return Zend_Layout::startMvc(); 
    }

    protected function _initViewHelpers() {
        $this->bootstrap('layout');
        $layout = $this->getResource('layout');
        $view = $layout->getView();
        $view->doctype('XHTML1_STRICT');
        $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
        $view->headTitle()->setSeparator(' - ');
        $view->headTitle('My Application');
        $view->headLink()->appendStylesheet('css/general.css');
        $view->headLink()->appendStylesheet('css/navigation.css');
    }

    protected function _initNavigation() {
        $this->bootstrap('layout');
        $layout = $this->getResource('layout');
        $view = $layout->getView();

        $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');

        $navigation = new Zend_Navigation($config);
        $view->navigation($navigation);
    }
}

/application/configs/application.ini:

[production]

; Models
includePaths.models = APPLICATION_PATH "/models/"

; Debug output
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0

; Bootstrap
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"

; Database
resources.db.adapter = "PDO_MYSQL"
resources.db.params.host = "localhost"
resources.db.params.dbname = "dabase"
resources.db.params.username = "root"
resources.db.params.password = "password"
resources.db.isDefaultTableAdapter = true

[development : production]

; Debug output
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

; Database
resources.db.adapter = "PDO_MYSQL"
resources.db.params.host = "localhost"
resources.db.params.dbname = "dabase"
resources.db.params.username = "root"
resources.db.params.password = "password"
resources.db.isDefaultTableAdapter = true
  • 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-06-10T17:09:47+00:00Added an answer on June 10, 2026 at 5:09 pm

    You need to change the way you name your models, because Zend autoloader can’t simply find the right file idue to way it loads models. So instead of having model like this:

    class Language extends Zend_Db_Table_Abstract {
    ....
    }
    

    you should name it like this:

    class Application_Model_Language extends Zend_Db_Table_Abstract {
    ....
    }
    

    and then instantiate:

    $languages = new Application_Model_Language();
    

    Please note models are mapped differently and your Application_Model_Language model class have to be placed in application/models/Language.php for this to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to retrieve book image and ISBN number using PHP and Zend framework.
I'm using Zend Framework for PHP and handling sessions with the Zend_Session module. This
I am using Zend Framework 1.9.6. I want to start using cron jobs. I
I am currently working on a big management system (in PHP using Zend Framework,
I have this sphinx search engine that I use through Zend using sphinxapi.php .
I am creating a web site using php, mysql and zend framework. When I
I'm using the zend framework and have started setting up really easy urls. I'm
I was playing around the new swiftmailer 4.0.4 using my zend studio embbeded apache
im really new to flash, how do i go about creating a variable which
I am really new with PHP and all I have to do is to

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.