Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
[1.7.2] Overwriting Routes from Modules
  • Suppose i have a module named "backend". I have this structure inside "app" folder:

    app/modules/backend/controller/user.php

    So, i can access my controller in URL/backend/user/index

    Then, i want to create in a controller that can be accessed via URL/backend/customer/index
    But for now i want to put it inside the app folder, not inside the backend module. So i create file:

    app/classes/controller/backend/customer.php

    The problem is, i cannot access the desired URL. I take a look at the core file, it seems that once the module is found, FuelPHP ignored the other controller inside a folder with same name, although FuelPHP cannot find the controller inside the module.

    What is the best approach for this?
  • You need to change class name to follow cascading filesystem convention.
    What are your controller classes names?
     
  • I already follow the class name.

    For class in the app folder:
    class Backend_Customer extends Controller_Core_Base {}

    But it still cannot be found.
  • Fuel doesn't fall back to global once the module is detected. So what you want to do is not possible.

Howdy, Stranger!

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

In this Discussion