Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Must i add action to every method i create?
  • I have this:

    class Controller_Register extends Controller { 
    public function action_do_register() { }
    }


    when i visit /register/index it says 404.. why?
  • HarroHarro
    Accepted Answer
    Because that would call action_index(), and that doesn't exist?

    And yes, you must add the "action_" prefix to every method that is routeable. Not only because that allows you to create non-routeable public methods too (methods that you want to call but are not output generating methods), but also to handle php reserved words.

    For example, without it you will never be able to use a URI like /products/list, since you can't create a list() method in your Controller.

Howdy, Stranger!

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

In this Discussion