PHP code example of cyhalothrin / yiiflow

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

    

cyhalothrin / yiiflow example snippets


class AppBootstrap implements yii\base\BootstrapInterface
{
    public function bootstrap($app)
    {
        \Yii::$container->set(
            'Flow\ConfigInterface',
            function () {
                $config = new Flow\Config();
                $config->setTempDir(Yii::getAlias('pathToChunksTempDir'));
                return $config;
            }
        );
    }
}

'controllerMap' => [
    'flow' => 'cyhalothrin\yiiflow\controllers\FlowController',
],

\cyhalothrin\yiiflowFlowFileInput::widget([
    'name' => 'file',
    'value' => $file, // необходимо восстанавливать значение
    'uploadAction' => ['/flow/upload'],
    'deleteAction' => ['/flow/delete'],
    'pluginOptions' => [
        'flowOptions' => [
            // конфигурация flow.js
        ],
    ],
]);

$form->field($model, 'files')->widget('\cyhalothrin\yiiflowFlow\FileInput', [
    // config
]);

$files = \cyhalothrin\yiiflow\UploadedFile::getInstancesByName('files');

$model->files = \cyhalothrin\yiiflow\UploadedFile::getInstances($model, 'files');

'controllerMap' => [
    'cleaning' => 'cyhalothrin\yiiflow\commands\CleaningController',
],

php yii cleaning