Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
404 route for a module
  • What I'm trying to establish is to get 404 working for modules. Let say you have a "admin" module and have a modules/admin/config/config.php file with
    return array(
     'routes' => array(
      '404' => 'admin/404',
     ),
    );
    

    So you have a modules/admin/classes/controller/admin.php with two action functions, action_index and action_404. The Request::_construct() has detected and found a valid module, thus $this->module is "admin". And it is normal that Request::execute() did not found a $controller in line 323
    if (method_exists($controller, $method))
    

    Thus line 347 gets executed
    $this->output = static::show_404(true);
    

    Within the static function Request::show_404() (line 110) the $this->module is not callable (due to the static). At the same time line 116
    Config::get('routes.404')
    
    is not null because the default application config file has a 404 route (welcome/404).
    What I want is that at this point the admin 404 route is called and not the application 404 route because the detected module has a 404 route overwrite (stated on top of this post). And if there is a 404 route overwite (in this case there is) this overwrite is used and thus the 404 action of the module is called and not the application 404.
    Has anyone made this already or have a solution/idea for this?
  • This has been fixed a few days ago in the develop branch.

Howdy, Stranger!

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

In this Discussion