0

Possible Duplicate:
How to indicate zend framework where my custom classes are

I'm trying to create a new library in Zend. I have a few classes in my new library dir (/library/my-lib)

When I try to create a object from a class in my new library I get a "class not found" found.

Do I need to set something up in my application.ini?

Community
  • 1
  • 1
Undefined
  • 1,899
  • 6
  • 29
  • 38

2 Answers2

1

To add custom class (or custom library) one can use zend framework's autoloader namespaces.

Add the below line in application.ini file

autoloaderNamespaces.custom = "Custom_"

OR

autoloaderNamespaces[] = "Custom_"

Even this:

autoloaderNamespaces.extension[] = "Custom_"

Is said to work.

Then it should find your libs. Btw this is a copy of this question

And like Zdenek Machek said change the name to be more standard with how zf names things. Ie: MyLib is a much better name then my-lib.

Community
  • 1
  • 1
Iznogood
  • 12,447
  • 3
  • 26
  • 44
1

Yes, add to application.ini

autoloaderNamespaces.extension[] = "MyLib_"

I would suggest also change my-lib to MyLib and class name then starts with MyLib_

Zdenek Machek
  • 1,758
  • 1
  • 20
  • 30