Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Models with multiple names
How do you generate a model with multiple names without creating a sub directory? The following: oil g model test_test name:string Creates: Creating model: /web/dev/fuel/app/classes/model/test/test.php
Creating migration: /web/dev/fuel/app/migrations/010_create_test_tests.php But I want to create: Creating model: /web/dev/fuel/app/classes/model/test_test.php
Creating migration: /web/dev/fuel/app/migrations/010_create_test_tests.php
You can not use an underscore in a FuelPHP class filename. The autoloader will not be able to load the class if you do, so why should oil support that?
So which naming convention should be used for a model with multiple words?
The FuelPHP Coding Standards (
) has the following sentence: "The use of camelcase is discouraged but cannot be prevented in some cases when putting the class in a subdirectory makes no sense." It seems to accept the possibility that camel case maybe used in some cases, but I cannot believe that a class name with multiple words is such a fringe scenario. Rich
It is PascalCase that should be used in these situations, though oil does not recognise uppercase.
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion