8

I'm looking to integrate tasks into a plugin I'm building. Whilst I know that the Craft documentation shows the Tasks Service/Model properties/methods in the full class reference, I can't find anything online about best practices regarding using tasks in plugins. Has anyone come across any articles about creating your own tasks?

1 Answer 1

5

I'm not aware of any articles or best practice documents.

There is a sample/simple PowerNap plugin that shows the basics of creating and running a task as well as the TaskService class reference documentation which you've already found.

1
  • One other headache I had when creating a task for a custom plugin - make sure you name the file/class for your task to be prefixed with the plugin name (which is a standard Craft convention). Something like MyPlugin_BeAwesomeTask.php. Commented Aug 30, 2015 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.