>
> But I am getting the below message and i don't know why:
>
> Fatal error: Class 'Category' not found in
> C:\wamp\www\eGal\application\controllers\CatController.php on line 21
>
> any help is highly appreciated
>
Based on the error you show here I'd say that you do not have your
autoloader configured in such a way that it can find your Category file.
Classes can only be autoloaded if you have the autoloader configured
properly.
For example something like this in your application's bootstrap would
register a new namespace for you:
require_once 'Zend/Loader/Autoloader.php';
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('My_');
Then you might have a class named My_Category in a file
named /path/to/your/library/My/Category.php
Which would look something like
class My_Category
{
}
Then you could access that class via
$cat = new My_Category();
And the autoloader would know, since you registered the "My" namespace
that it should look in the "My" directory for classes that are prefixed
with My_ similar to how it knows to look in the Zend folder for classes
prefixed with Zend_
Your problem isn't so much with Zend_Db, rather it seems you are missing
some details of your application configuration?
--Mike H
没有评论:
发表评论