PHP code example of mdmsoft / yii2-action-filter

1. Go to this page and download the library: Download mdmsoft/yii2-action-filter 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/ */

    

mdmsoft / yii2-action-filter example snippets


$config['modules']['gii'] = [
    'class' => 'yii\gii\Module',    
    'as access' => [
        'class' => 'mdm\filter\EnterCode',
        'timeout' => 600, // default 300
        'validationCallback' => function ($code, $actionId) {
            return $code === 'bismillah';
        },
        'only' => [
            'default/view', // actions
        ]
    ],
]

    ...
    'as access' => [
        'class' => 'mdm\filter\EnterCode',
        'viewFile' => '@your/views/verify.php',
        ...