PHP code example of mihaildev / yii2-flexible-controller

1. Go to this page and download the library: Download mihaildev/yii2-flexible-controller 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/ */

    

mihaildev / yii2-flexible-controller example snippets


'controllerMap' => [
        'auth' => [
            'class' => 'mihaildev\flexibleController\Controller',
            'behaviors' => [
                'access' => [
                    'class' => 'yii\filters\AccessControl',
                    'only' => ['logout'],
                    'rules' => [
                        [
                            'actions' => ['logout'],
                            'allow' => true,
                            'roles' => ['@'],
                        ],
                    ],
                ],
                'verbs' => [
                    'class' => 'yii\filters\VerbFilter',
                    'actions' => [
                        'logout' => ['post'],
                    ],
                ],
            ],
            'actions' => [
                'login' => 'standalone\action\LogIn',
                'logout' => 'standalone\action\LogOut',
            ]
        ]
    ],