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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:19:42+00:00 2026-05-25T10:19:42+00:00

New to Zend Framework. I been reading and found that whatever mentioned in application.ini

  • 0

New to Zend Framework. I been reading and found that whatever mentioned in application.ini is initialized.

1 – My Question is if I have mentioned include path for Library in ini than why I need to use include path again in index file like

// Include path
set_include_path(
    BASE_PATH . '/library'
);

2 – in application.ini should I write includePaths.library like APPLICATION_PATH “/../library” OR APPLICATION_PATH “/library”. Keeping in mind my index APPLICATION_PATH variable?

3 – Why should I _initView() in BootStarp file. What is the use of that code like

$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
                'ViewRenderer'
            );
            $viewRenderer->setView($view); 

application.ini mentioned

;Include path
includePaths.library = APPLICATION_PATH "/../library"

Bootstrap

<?php

    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
    {
        protected function _initView()
        {
            // Initialize view
            $view = new Zend_View();
            $view->doctype('XHTML1_STRICT');
            $view->headTitle('My Project');
            $view->env = APPLICATION_ENV;

            // Add it to the ViewRenderer
            $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
                'ViewRenderer'
            );
            $viewRenderer->setView($view);

            // Return it, so that it can be stored by the bootstrap
            return $view;
        }
    }

index

<?php
define('BASE_PATH', realpath(dirname(__FILE__) . '/../'));
define('APPLICATION_PATH', BASE_PATH . '/application');

// Include path
set_include_path(
    BASE_PATH . '/library'
);

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV',
              (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV')
                                         : 'production'));

// Zend_Application
require_once 'Zend/Application.php';

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);

$application->bootstrap();
$application->run();
  • 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-25T10:19:43+00:00Added an answer on May 25, 2026 at 10:19 am

    1 and 2 are a lingering redundancy from older versions of Zend Framework. You may generally choose one method and stick to it.

    Either index.php

    // Ensure library/ is on include_path
    set_include_path(implode(PATH_SEPARATOR, array(
        realpath(APPLICATION_PATH . '/../library'),
        get_include_path(),
    )));
    

    or application.ini

    includePaths.library = APPLICATION_PATH "/../library"
    

    Personally, I favour the former.

    Your Bootstrap.php file also seems to have a few older ZF habits. The newer application architecture includes a resource plugin for the view. Simply place this into your application.ini file

    resources.view.encoding = "utf-8"
    

    and change your bootstrap method to

    // don't call this _initView as that would overwrite the resource plugin
    // of the same name
    protected function _initViewHelpers()
    {
        $this->bootstrap('view'); // ensure view resource has been configured
        $view = $this->getResource('view');
    
        $view->doctype('XHTML1_STRICT');
        $view->headTitle('My Project');
        $view->env = APPLICATION_ENV;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a new installation of a Zend Framework application for
i have been using a modular structure for my zend framework application. This is
I am new to zend. I have been asked to redevelop a website that
I am pretty new to the zend framework and the JQuery helper. I have
I have been getting into Unit Testing with Zend Framework. I am getting used
I am a very new zend framework and phpunit test learner. I have a
For the past time I have been working on a Zend Framework based webshop
I am very new to Zend Framework. And i have tried to get the
I'm trying to add a new folder to the application folder in zend framework,
I have been using Zend Framework for a while now. I am having an

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.