Advanced module and module controller

edited October 2013 in Modules
At some point with an early v1b for Fuel, I was able to create an advanced module (thus getting portability) but was able to re-use Fuel's module controller to serve up the regular list & create/edit pages.

I think that was by accident more than design, I set the (simple) module config to have 'model_location' point to the advanced module and didn't include the advanced module in 'modules_allowed' in MY_fuel. At least that's how I think it worked. Now with a recent copy of FUEL, I can't seem to have an advanced module and make it use the module controller for vanilla CRUD stuff. At least not by my efforts at configuration.

If I remove the advanced controller, then (ta dah) the old way works, but I wonder if there is a configuration way. The real issue I want to overcome is this:

1) I want a controller method to do custom stuff eg /fuel/my_module/import (using 'list_actions')
2) I want also to (re) use the vanilla FUEL crud methods

The solution lies with the routes file in the advanced module probably, but I can't quite work out how.

Comments

  • edited 10:06AM
    When you say "remove the advanced controller", what controller is that? By default, there is a route setup for the file at fuel/{module}/controller/my_module module.php that appears at the URI of http://localhost/fuel/my_module/. It sounds like you may want to extend the module controller to get all of it's functionality and then route to your new controller. The fuel/pages controller does this (as does the navigation and users).
  • edited 10:06AM
    If I simply rename or remove the advanced module controller (generated by the CLI process), then the drop through behaviour goes to Fuel's module it seems. So that way the usual CRUD happens anyway. I don't like that especially, but it's quick and works!

    I'll take a look at extending module.php, that could be quite minimal.
Sign In or Register to comment.