Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Multi word controllers/models
  • In my scheme I have many tables/models that have underscore in the table name. Such as: website_settings, notification_logs, etc.. 

    When i try to use oil to generate the controller/view and models for these.. The underscore is being treated as a nested folder. I'm aware that this is how oil works, but are there any work arounds for problems like this. Or do I have to create the controller/model as one name and then add a dash where appropriate?

    Thanks,
  • That would be best, yes. If you have tables like that, it would be unlikely you want your controllers to be named like this?
  • I'm not a big fan of making a folder for each _ in table names
    Here is how I do usually : 
    1. oil g model notificationlogs
    2. change classname to Controller_NotificationLogs
    3. protected $_table_name = 'notification_logs'

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion