0

I am looking to create my own collection of class files in the library/common folder

/library/common/*class files go in here*

Inside the folder I will have various class files that I want to make available

such as

DecoratorSimple.php

example of the code can be seen below?

class Common_Decorator_SimpleInput extends Zend_Form_Decorator_Abstract
{
  // code goes in here
}

The question I have is how do I get the zend application to automatically load anything in common folder that has the the prefix of Common_

I have tried adding the following to the bootstrap but it did not work

protected function _initTestAutoLoader(){

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

    // try and load the class
    $testVar = new Common_Decorator_SimpleInput();
    var_dump($test);
}
Robbo_UK
  • 11,351
  • 25
  • 81
  • 117
  • What's the error that you get? Also, I think the problem is because you didn't register /Library/ in `include_path` – Rezigned Oct 05 '12 at 15:58

1 Answers1

1

Is your class name matching the library path...
eg Common_Decorator_SimpleInput
must be in /library/Common/Decorator/SimpleInput.php

Michael Harroun
  • 299
  • 2
  • 6