Re: [fw-general] Zend_Loader_Autoloader: Must I rewrite all my class and instances?

2009-06-17 Thread Mon Zafra
You can add application/models to your include path and set the fallback
flag

set_include_path(get_include_path() . PATH_SEPARATOR .
'../application/models');
$autoloader->setFallbackAutoloader(true);

   -- Mon


On Wed, Jun 17, 2009 at 3:03 PM, Alessandro Camilli wrote:

>
> In my folder ../application/models/
> there are many classes.
>
> With the new behavior of zf 1.8.3 :
> In my bootstrap:
>
> require_once 'Zend/Loader/Autoloader.php';
> $autoloader = Zend_Loader_Autoloader::getInstance();
>
> $autoloader->registerNamespace('My');
> $autoloader->registerNamespace('i5');
>
>
> $resourceLoader= new Zend_Loader_Autoloader_Resource(array(
>'basePath'  =>  APPLICATION_DIRECTORY . '/',
>'namespace' => '',
>'resourceTypes' =>  array(
>'models' => array(
>'path' => 'models/',
>'namespace' => 'Model'
>),
>'forms' =>  array(
>'path'  => 'forms/',
>'namespace' => 'Form'
>),
>)
> ));
>
> Must I class change in models?
> from
> class User {}
> to
> class Model_User
>
> and after all my instances?
> from
> user = new User()
> to
> user = new Model_User()
>
>
> --
> View this message in context:
> http://www.nabble.com/Zend_Loader_Autoloader%3A-Must-I-rewrite-all-my-class-and-instances--tp24068063p24068063.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


[fw-general] Zend_Loader_Autoloader: Must I rewrite all my class and instances?

2009-06-17 Thread Alessandro Camilli

In my folder ../application/models/
there are many classes.

With the new behavior of zf 1.8.3 :
In my bootstrap:

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();

$autoloader->registerNamespace('My');
$autoloader->registerNamespace('i5');


$resourceLoader= new Zend_Loader_Autoloader_Resource(array(
'basePath'  =>  APPLICATION_DIRECTORY . '/',
'namespace' => '',
'resourceTypes' =>  array(
'models' => array(
'path' => 'models/',
'namespace' => 'Model'
),
'forms' =>  array(
'path'  => 'forms/',
'namespace' => 'Form'
),
)
));

Must I class change in models?
from 
class User {}
to
class Model_User

and after all my instances?
from 
user = new User()
to
user = new Model_User()


-- 
View this message in context: 
http://www.nabble.com/Zend_Loader_Autoloader%3A-Must-I-rewrite-all-my-class-and-instances--tp24068063p24068063.html
Sent from the Zend Framework mailing list archive at Nabble.com.