Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Could restful work in modules
  • I have three resr controller at

    //app\classes\controller
    class Controller_Restapi extends \Controller_Rest
    {
        public function get_list()
        {
            return $this->response(array(
                'type' => 'base rest',
            ));
        }
    }

    // app\modules\main\classes\controller
    namespace Main;
    class Controller_Restapi extends \Controller_Rest
    {
        public function get_list()
        {
            return $this->response(array(
                'type' => 'main module',
            ));
        }
    }

    //app\modules\handa\classes\controller
    namespace Honda;
    class Controller_Restapi extends \Controller_Rest
    {
        public function get_list()
        {
            return $this->response(array(
                'type' => 'honda module',
            ));
        }
    }

    I want call module rest controller, rather than rest at app\classes\controller,
    Could it possible?
    tks.

  • HarroHarro
    Accepted Answer
    Yes, not a problem. Everything you can do in app you can do in a module.

    Just call them via http://yourhost/main/restapi/list and http://yourhost/honda/restapi/list.

    Make sure your module path is defined in app/config/config.php (it's commented out by default).
  • tks Harro Verton !

Howdy, Stranger!

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

In this Discussion