0
votes

How to create an controller in app folder in cake php?

class AppSessionController extends AppController {

}

I want to create another controller parallely to AppController, then I want to extends it with AppController

The new created controller can be extended to whole application(All controllers in app/controllers).

Is it possible ?

EDIT: In app/controllers

class customController extends AppSessionController {

}
1
I don't know what you're asking. You want to create an AppSessionController and then have all your controllers extend AppSessionController? - tigrang
@tigrang: Yes, Needs a controller which can be extended like AppController to whole application .The new created controller want to extended from AppController also - Justin John

1 Answers

0
votes

I don't see why you don't implement it just in AppController but if you really have a need you can do 1 of two things

A)

class AppController extends CustomController {}
CustomController extends Controller {}

B)

class CustomController extends AppController {}
Update all controllers to extend CustomController

Or if its just common functionally, perhaps a Component will do then add the component to AppController