PHP code example of pvol / flow
1. Go to this page and download the library: Download pvol/flow library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pvol / flow example snippets
// 在config/flow/目录下添加如下配置文件:
// 配置文件名:项目名称.php
return [
'hooks' => [
'after_step' => [ // 流程步骤执行完时执行
'App\Models\Zyd\Flow\Hook\PreOrder' // 需要是hook类的子类
],
],
'steps' => [
'step1'=>[
'title' => 'step1',
'action' => [ // 执行的动作,系统默认动作在Action中提供,也可以自定义
'App\Library\Flow\Action@create', // 新建
'App\Library\Flow\Action@storage', // 保存
'App\Library\Flow\Action@publish', // 发布
],
'roles' => [ // 什么角色可以执行
'channel'
],
'condition'=>[ // 流程执行到第几步可以执行
],
'createto'=>'step2',
'run_type'=>'', // 执行方式 现支持: accept(先接受后执行) history(历史执行人)
],
'step2'=>[
'title' => 'step2',
'action' => [ // 执行的动作,系统默认动作在Action中提供,也可以自定义
'App\Library\Flow\Action@accept', // 接受
'App\Library\Flow\Action@over', // 完成
],
'roles' => [ // 什么角色可以执行
'front_control'
],
'condition'=>[ // 流程执行到第几步可以执行
'step2'
],
'run_type'=>'accept', // 执行方式 现支持: accept(先接受后执行) history(历史执行人)
]
]
];