Good morning.

I'm trying to extends a class (a custom base model) that extends the
AppModel.

I've already done it for the controllers. I have a CustomController that
extends the AppController and then I have all my controllers that
extends the CustomControllers (code at the end).

Now, as I said before, I'm trying to do the same with the model, but I
always get the error

Fatal error: Cannot redeclare class mycustommodel in
H:\www\multi-cake\casting\models\Mycustommodel.php on line 2

for every class names I specify.

Code at the end.

What it could be?

Thanks a lot
Davide

//////////////
//controllers/custom_controller.php
class CustomController extends AppController{
   //some variables/method useful for all controllers
}

/////////////
//controllers/users_controller.php
require("custom_controller.php");

class UsersController extends CustomController{
   var $name="Users";
   var $scaffold;

   //my actions
}

/////////////
//models/mycustommodel.php
class Mycustommodel extends AppModel{
   //...
}

/////////////
//models/user.php
require("mycustommodel.php");
class User extends Mycustommodel{
   //...
}

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to