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
How to call Controller method from the Task
jbrabo
May 2014
I'm building a cron job task and I need to call one of the Controllers methods. I'm trying to use:
$data = \Request::forge('controller/test')->execute()->response();
but the Task just terminates after this call with no response.
method in the controller:
public function action_test()
{
return 'test';
}
KoolCoder
May 2014
Try
echo 'test';
Harro
May 2014
After
$data = \Request::forge('controller/test')->execute()->response();
your $data will contain a Response object. Anything the controller method has returned will be stored in the response body, accessable via $data->body().
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
Harro
May 2014
KoolCoder
May 2014