I have an existential question that I hope someone can answer.
Why is it that Cakephp controller needs to have the "controller" word attached?
I know what is the naming convention, but nowhere does it says why is it so (well, maybe it's written somewhere, but I haven't found it).
Controller classnames are plural, CamelCased, and end in Controller
We don't have PostModel.php
, WhateverModel.php
or viewView.ctp
, addView.ctp
. With models it's just Post.php
or Item.php
. With views is... well, anything, but there's no need of a "View" append at the end of the action. Why the difference with controllers?
I have seen a few questions where the error is that they have ItemModel.php
, and I understand why the confusion if the controller is ItemsController.php
(though, granted, it's not an excuse to not read the docs).
I thought maybe it was to help avoiding inflection problems, like with a Fish.php
model, the controller would be also Fish.php
if we didn't add the controller part. But the separation of folders is quite clear and having
/Controller
Fish.php
/Model
Fish.php
isn't really a problem... or is it?
My question is why, not how the naming convention for controllers is like that, and if there's any logical reason besides a "just because". Even a "we started like that in version 0.0.1 and then it was to late to change it" would suffice.