Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Can I call a Task within a controller?
  • I would like to give an option in my admin panel to fire some tasks without having to wait for a cron job to execute it.

    Is there a way to easily do this?

    I would have thought that is as simple as using the class like this:

    Fuel\Tasks\MyTask::run();

    but if I do that I get the following error message:

    ErrorException [ Error ]: Class 'Fuel\Tasks\MyTask' not found

    Any way to do this?

    Thank you.
  • You have to load the class manually. They don't use the cascading filesystem, so the autoloader can't load them.

Howdy, Stranger!

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

In this Discussion