2009年8月4日星期二

RE: [fw-db] Creating an instance of database table

Thanks a lot for your usual support...I managed to get right.

Best Regards,
Mohammed Saleh Al Ashour

SAP Health Care Division
ARAMCO-Dhahran - LIP Area, Bldg # 3118 (C-30)
: +966 3 872-9221
: MOHAMMED.ASHOUR.2@ARAMCO.COM



-----Original Message-----
From: Erdal YAZICIOGLU [mailto:erdal.yazicioglu@gmail.com]
Sent: Tuesday, August 04, 2009 10:35 AM
To: 'Michael Hernandez'; 'ashoms0a'
Cc: fw-db@lists.zend.com
Subject: RE: [fw-db] Creating an instance of database table

As described in Rob Allen's tutorial you can initialize Autoload in your
bootstrap file as follows

Class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
Protected function _initAutoload()
{
$moduleLoader = new
Zend_Application_Module_Autoloader(array(
'namespace'=>'',
'basePath'=>APPLICATION_PATH));
Return $moduleLoader;

}

Then you are good to go...

Erdal YAZICIOGLU
Field Project Engineer Manager
Shell GTL Pearl Project
Page Europa S.R.L
Doha-Qatar
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)
www.erdalyazicioglu.com.tr

-----Original Message-----
From: Michael Hernandez [mailto:sequethin@gmail.com]
Sent: Monday, August 03, 2009 9:20 PM
To: ashoms0a
Cc: fw-db@lists.zend.com
Subject: Re: [fw-db] Creating an instance of database table

On Mon, 2009-08-03 at 11:03 -0700, ashoms0a wrote:

>
> 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



The contents of this email, including all related responses, files and attachments transmitted with it (collectively referred to as "this Email"), are intended solely for the use of the individual/entity to whom/which they are addressed, and may contain confidential and/or legally privileged information. This Email may not be disclosed or forwarded to anyone else without authorization from the originator of this Email. If you have received this Email in error, please notify the sender immediately and delete all copies from your system. Please note that the views or opinions presented in this Email are those of the author and may not necessarily represent those of Saudi Aramco. The recipient should check this Email and any attachments for the presence of any viruses. Saudi Aramco accepts no liability for any damage caused by any virus/error transmitted by this Email.

没有评论: