Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How to restrict access to controllers which have not specified in routes.php ???
  • How to restrict access to controllers which have not specified in routes.php ???
  • Like with all question, the answer is: it depends. The quickest way is to end your route definitions with a catch-all: "(:any)" => ...". And either route that to a 404 controller of some sort, or assign a closure that throws a HttpNotFoundException. You can also catch it in the controller, either in a specific method, or using the router() method, by checking if Request::active() == Request::main(). If so, it's a URI request. If not, it's an HMVC call.

Howdy, Stranger!

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

In this Discussion