We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

ControllerBase VS BaseController

I have noticed that you are using ControllerBase instead of BaseController.

What is the reason for that? Why to change the order and to make an exception?



8.1k
edited Jul '14

Because that's not an actual controller. (In fact, you could declare the base controller as an abstract class). So to avoid confusion with being an actual controller (with the name base), the naming is different.



37.0k

@renskill yeah, but then why Laravel uses it differently:

https://laravel.com/docs/controllers

Is ControllerBase the way the PSR-1 or PSR-2 is telling you to use ControllerBase or BaseController?



8.1k

I'm not sure, perhaps Laravel has some kind of 'fixed' BaseController implementation? In Phalcon, how you implement this (and a lot of other things), is less strict / not tied to conventions so much I reckon.

Except for the class-naming, I believe this his little to do with PSR standards?



37.0k
edited Jul '14

Could the main developers explain why they chose ControllerBase instead of BaseController? What about FrontendController vs ControllerFrontend and BackendController vs ControllerBackend?