fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

oil g controller creates singular file and controller names #30

Closed ghost closed 13 years ago

ghost commented 13 years ago

Using FuelPHP v1.0 Final

When using oil g controller to create a new controller it creates the singular version of the filename and the classname rather than the pluralized one.

Example: php oil g controller url

Creates: app/classes/controller/url.php -> class Controller_Url extends ...

Rather than app/classes/controller/urls.php -> class Controller_Urls extends ...

Relevant lines are in packages/oil/classes/generate/generate.php

44: $filename = trim(strreplace(array('', '-'), DS, $singular), DS); 52: array_unshift($args, $singular);

philsturgeon commented 13 years ago

I'm pretty sure this was fixed in develop, did you check?

philsturgeon commented 13 years ago

Oh no, the issue that was fixed was a bug. This is just you doing it wrong!

php oil g controller urls
philsturgeon commented 13 years ago

I've made it so it will accept either. Solved!