Workflow Manager for Yii2. Extends Yii2-Workflow to provide an interface to manage workflows.
The preferred way to install this extension is through composer.
Either run
$ composer require cornernote/yii2-workflow-manager "*"
or add
"cornernote/yii2-workflow-manager": "*"
to the require
section of your composer.json
file.
$ php yii migrate --migrationPath=@cornernote/workflow/manager/migrations
$config = [
'components' => [
'workflowSource' => [
'class' => 'cornernote\workflow\manager\components\WorkflowDbSource',
],
],
'modules' => [
'workflow' => [
'class' => 'cornernote\workflow\manager\Module',
],
],
];
Simply visit ?r=workflow
within your application to start managing workflows.
Once you have defined a workflow, you can attach it to a model as follows:
class Post extends \yii\db\ActiveRecord
{
public function behaviors()
{
return [
[
'class' => \raoul2000\workflow\base\SimpleWorkflowBehavior::className(),
'defaultWorkflowId' => 'post',
'propagateErrorsToModel' => true,
],
];
}
}
Comments