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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:17:51+00:00 2026-05-26T09:17:51+00:00

so I know that in Zend Framework if your function name follows certain path

  • 0

so I know that in Zend Framework if your function name follows certain path convention, eg. Path_To_Function::function() when the function is located in path/to/function (or something to this nature), ZF will automatically include the required file in that location

but that’s not what I do….what I do is basically put all the places where I want to include into the php include_path and then just require the file and then call the function.

like the following

require_once('Class.php');
Class::something();

whereby Class.php is inside a directory within the include_path

but then this is redundant since I’m already specifying the class name in the static function call Class::something() and virtually all my functions are static…

is there a way to configure/hack zend so that if I make a static call:

SomeClass::dosomething(); 

it will automatically execute require_once('SomeClass.php') based on that static call’s class name?

  • 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-26T09:17:52+00:00Added an answer on May 26, 2026 at 9:17 am

    Put this in your Bootstrap class

    protected function _initAutoloader()
    {
        $autoloader = Zend_Loader_Autoloader::getInstance();
        $autoloader->setFallbackAutoloader(true);
        return $autoloader;
    }
    

    See http://framework.zend.com/manual/en/zend.loader.autoloader.html#zend.loader.autoloader.usage

    Really, you should be namespacing your classes as this not only makes autoloading easier, but prevents possible conflicts, eg

    // library/My/Class.php
    class My_Class { // ...
    
    // library/My/SomeClass.php
    class My_SomeClass { // ...
    

    then you just add the namespace prefixes to the autoloader in your application config

    autoloadernamespaces.My = "My_"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I know that you can set a custom default action in Zend Framework
Do you know of any open-source Zend Framework applications besides Magento that show in
I am testing my Zend Framework application and would like to test that something
How do I implement a sidebar in Zend Framework? I know that I can
I know that I can do something like $int = (int)99; //(int) has a
I have a domain that'll be using Zend Framework and I need to modify
I'm working on a project now that isn't based on Zend Framework, however I
I'm relatively new to MVC and the Zend Framework. That being said, I feel
The Zend Framework coding standard mentions the following: For files that contain only PHP
Let me begin by saying this; I know that similar questions exist, but they

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.