:-D
Ralph Schindler-2 wrote:
>
> The problem here is that you are attempting to load the Category Model,
> but its not loadable by the default autoloader.
>
> Autoloading is where php files containing classes can be found on first
> use without the use of require_once statements.
>
> If you are using Zend_Application, you would need to call Category
> 'Default_Model_Category' for it to be autoloaded.
>
> I suggest you have a look at the ZF quickstart application located here:
>
> http://framework.zend.com/docs/quickstart
>
> specifically take note to the class names, and their location in the
> filesystem. There are also plenty of comments in there to help you
> understand the anatomy of an application with Zend Framework.
>
> Hope this helps,
> Ralph Schindler
>
>
> ashoms0a wrote:
>> Hi there,
>> I am a new zend framework user and I am having a problem in instantiating
>> an
>> instance of one of my model inside an action controller.
>>
>> I have one model as shown below
>>
>> require_once 'Zend/Db/Table/Abstract.php';
>>
>> class Category extends Zend_Db_Table_Abstract{
>>
>> protected $_name = 'category';
>> }
>>
>> The controller is as shown below:
>> require_once 'Zend/Controller/Action.php';
>>
>> class CatController extends Zend_Controller_Action {
>>
>> public $cat;
>>
>> public function init() {
>>
>> $this->cat = new Category();
>> }
>>
>> public function indexAction() {
>> }
>>
>> }
>>
>> 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
>>
>
>
--
View this message in context: http://www.nabble.com/Creating-an-instance-of-database-table-tp24795359p24795869.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论