![]() |
|
ybRunTaskPlugin - 0.1.2Run a task wihtin an action |
|
![]() |
4
users
Sign-in
to change your status |
Run a task wihtin an action |
The ybRunTaskPlugin allow you to run a task within an action, just like you'd be doing in a task
Install the plugin
$ symfony plugin:install ybRunTaskPlugin
Add the plugin to the loaded plugin in your config/ProjectConfiguration.class.php $this->enablePlugins('ybRunTaskPlugin');
Clear your cache
$ symfony cc
You can now run a task from an action
class homeActions extends sfActions
{
public function executeRuntask(sfWebRequest $request) {
$ret = $this->runTask('generate:task', 'hello');
if(null != $ret) {
$this->msg = $ret->getMessage();
} else {
$this->msg = 'doing fine ?';
}
}
}
For now, the method returns nothing if the task ran fine. Otherwise it returns an exception.
Maybe catch the logSection events, store them and return them to the action.
Thanks to Garfield-Fr on #symfony-fr@freenode and Nicolas loeuillet for small pieces of code.
| Name | Status | |
|---|---|---|
|
|
lead |