fatfree-core
fatfree-core copied to clipboard
Autoload: try convert camel / pascal to snake case for files name.
In the current version if you name your clases for example like ApiController
the autoload look for a file called apicontroller.php
or ApiController.php
but not for api_controller.php
.
I think, since file and class naming are part of good code practices, F3 should add this case prior to ease some class naming convention instead to force to think to the file name first.
Thoughts?
F3 is just a kick-off for the most cases and considering most ppl somehow follow PSR-4, I'd tend to say that your case is not that common :)
Nevertheless, as far as I understand when taking a look into the autoload-function, setting the AUTOLOAD-var properly allows you to add a function to transform the classname for your needs. If this still does not cover your needs, there is spl_autoload_register
as the last resort.
I see, I would like F3 have this out of the box, for people using another frameworks like CodeIgniter, Laravel (or Rails) this is a common behavior.
UPDATE: I saw the reference on PSR-4 and you're right. I gonna close the PR.