jinowom / yii2-workflow-manager
jinowom-workflow Manager for Yii2
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- jinowom/yii2-workflow: 1.2.0
- jinowom/yii2-workflow-view: 1.0.0
- yiisoft/yii2: *
- yiisoft/yii2-jui: ~2.0.0
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
README
jinowom-workflow Manager for Yii2 友情提示: 本程序代码仅供特定业务自用; 如自行使用,不确保其在任何环境中的可用性。 tips: This program code is only used for specific business; If it is used by itself, its availability in any environment is not guaranteed.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist jinowom/yii2-workflow-manager "*"
or add
"jinowom/yii2-workflow-manager": "*"
to the require section of your composer.json
file.
Configuration
$config = [ 'components' => [ 'workflowSource' => [ 'class' => 'jinowom\workflow\manager\components\WorkflowDbSource', ], ], 'modules' => [ 'workflow' => [ 'class' => 'jinowom\workflow\manager\Module', ], ], ];
Usage
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' => \jinowom\workflow\base\SimpleWorkflowBehavior::className(), 'defaultWorkflowId' => 'post', 'propagateErrorsToModel' => true, ], ]; } }
Usage
Once the extension is installed, simply use it in your code by :
<?= \jinowom\workflow\manager\AutoloadExample::widget(); ?>``` ## Links - [Yii2 Extension](http://www.yiiframework.com/extension/yii2-workflow-manager) - [Composer Package](https://packagist.org/packages/jinowom/yii2-workflow-manager)