I have seen a few posts regarding this question but none were answered to the topic on which they were asked. I have a ZendFramework project (v 1.12) and I want to do some changes in the file naming conventions.
The files and folders are named in Pascal case and I want to make the following changes:
- rename all the files/folders to lowercase (this works)
- I want dashes (
"-"
) in between words. The Zend maual says that dashes could be there in the file names. But then again says that they should be mapped to the class names, (A Class Name cannot contain a-
!!). And now there isZend Router
, it translates the-
in URL and joins the words in between them back to the Pascal case. How do I manipulate that?
For example, Here is a file name: TestingDemoController.php
, I want to change the name as testing-democontroller.php
(actually I was thinking of making it as testing-demo.controller.php
but don't know how possible is it.) For the previous filename, the URI
used to be something like Testing-Demo
. How can the router be configured to not treat -
as a special character?
Edit: Questions on PSR:
On the suggestion of @apokryfos, I have been reading through PSR releases, PSR-0 and PSR-4 mostly.
- looking at my class names (directories separated with underscore until the Terminating class name) I feel that we have used PSR-0 in our project.
- On my approach to the change in project structure (having dashes in between file names). This goes against PSR-4,
The terminating class name corresponds to a file name ending in .php. The file name MUST match the case of the terminating class name.
Is the above point, the only point which I am going against?
- This is what I feel about the ramifications that can happen on me doing the file name (dashed) and writing my own
autoloader
: When looking for the files inlibraries
, the files will be looked by my autoloader, on failure the search will fallback to the Standard Autoloader which will finally resolve them? This is leading to unnecessary lookups.
Please correct me here if I am understanding it wrong and if am missing something?