mdmsoft/yii2-action-filter Force entry code to enter

actionfilter

yii2-action-filter

Force entry code to enter to the action.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require mdmsoft/yii2-action-filter "~1.0"

for dev-master

php composer.phar require mdmsoft/yii2-action-filter "dev-master"

or add

"mdmsoft/yii2-action-filter": "~1.0"

to the require section of your composer.json file.

Usage

After instalation done. Attach filter to Module or Application

$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
        ]
    ],
]

You can cutomize view of verify controler by setting property viewFile

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

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.1 is the latest of 2 releases



BSD-3-Clause license
Stats
3 github stars & 7 github forks
0 downloads in the last day
10 downloads in the last 30 days
1618 total downloads