Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Could restful work in modules
David_0102
November 2013
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.
Harro
November 2013
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).
David_0102
November 2013
tks Harro Verton !
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
David_0102
November 2013
Harro
November 2013