So I'm developing quite a large application which has a large number of controllers. I'm wondering what the proper PSR compatible practice would be for this situation?
A directory example:
project\workbench\stevebauman\package\src\controllers\WorkOrder\WorkOrderController.php
An example use statement:
use Stevebauman\Package\Controllers\WorkOrder\WorkOrderController;
If I sub-namespace the work order folder (since there are many other controllers to do with work orders), should I namespace the Controller
with WorkOrder
? Or since this is already in a sub-namespace, should I just be using:
use Stevebauman\Package\Controllers\WorkOrder\Controller;
For the main work order controller, and do away with the prefix entirely?
I'm looking for a PSR standard if it exists. I'm not sure what is generally used in large directory projects. For example what if work orders had attachments? Would I do something like this (sub-namespaces indicate new sub-folder)?
use Stevebauman\Package\Controllers\WorkOrder\Attachment\Controller;
or:
use Stevebauman\Package\Controllers\WorkOrder\AttachmentController;
or even:
use Stevebauman\Package\Controllers\WorkOrderAttachmentController;
I hope my confusion here is justified. Can anyone lend some suggestions? Thanks!