PHP code example of open20 / amos-workflow

1. Go to this page and download the library: Download open20/amos-workflow 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/ */

    

open20 / amos-workflow example snippets


    
    'modules' => [
        'workflow' => [
           'class' => 'open20\amos\workflow\AmosWorkflow',
        ],
    ],
    

    return [
        .
        .
        .
        '@vendor/open20/amos-workflow/src/migrations',
        .
        .
        .
    ];
    

 public function behaviors()
{
    return ArrayHelper::merge(parent::behaviors(), [
        .
        .
        .
        'workflow' => [
            'class' => SimpleWorkflowBehavior::className(),
            'defaultWorkflowId' => self::NEWS_WORKFLOW,
            'propagateErrorsToModel' => true
        ]
    ];
}

    return [
        .
        .
        .
        'hideWorkflowTransitionWidget' => true
        .
        .
        .
    ];
    

    <?= WorkflowTransitionWidget::widget([
        'form' => $form,
        'model' => $model,
        'workflowId' => ShowcaseProject::SHOWCASEPROJECT_WORKFLOW,
        'classDivIcon' => 'pull-left',
        'classDivMessage' => 'pull-left message',
        'viewWidgetOnNewRecord' => true,
        'translationCategory' => 'amosshowcaseprojects'
    ]); 
bash
    php yii migrate/up --migrationPath=@vendor/open20/amos-workflow/src/migrations