PHP code example of mihaildev / yii2-backend

1. Go to this page and download the library: Download mihaildev/yii2-backend 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-backend example snippets


        'preload'=>['backend'],
        ...
        'components' => [
        ...
                'backend' => [
                        'class' => 'mihaildev\backend\Component',
                        
                        'onBackend' => function(){
                                Yii::$app->user->loginUrl = ['/backend/login'];
                        },
                        'onFrontend' => function(){
                                Yii::$app->user->loginUrl = ['/site/login'];
                        },
                
                
                ],
          ...
          ]


class SomeController extends Controller implements BackendControllerInterface{

}