Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
What does the request class really do?
  • I'm working on a project, and inside of a helpher.php file I found the following:

    public static function getCurrentRoute() {
    $request = Request::active();
    return $request->route->strip_extension;
    }

    How can I interpret this code?
    I'm mainly confused about what the active function does..
    thanks..



  • HarroHarro
    Accepted Answer
    FuelPHP has HMVC built in as part of it's core. It means that requests can fire secondary requests, and that in turn means the main request (the one initialized by the client) is not always the active or current request.

    So this method returns the value of the strip extension property of the route object associated with the active request (and not the current route as the method name suggests).

    See https://en.wikipedia.org/wiki/Hierarchical_model–view–controller and http://fuelphp.com/docs/general/hmvc.html for more info on HMVC.

Howdy, Stranger!

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

In this Discussion