eddycjy / e-admin
e-admin
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Language:JavaScript
Requires
- php: >=5.6.0
- eddycjy/yii2-iconpicker: @dev
- eddycjy/yii2-ueditor: @dev
- kartik-v/yii2-field-range: *
- kartik-v/yii2-widget-datepicker: @dev
- kartik-v/yii2-widget-fileinput: @dev
- kartik-v/yii2-widget-select2: @dev
- moonlandsoft/yii2-phpexcel: *
- phpoffice/phpexcel: ^1.8
- softark/yii2-dual-listbox: ^1.0
This package is not auto-updated.
Last update: 2025-03-02 07:01:41 UTC
README
Requirements
- PHP >= 5.6.0
- YII >= 2.0
Installation
一、Install yii advanced
二、Add yii database connection config
'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=xxx', 'username' => 'xxx', 'password' => 'xxx', 'tablePrefix' => 'xxx_', 'charset' => 'utf8', ],
二、
composer require eddycjy/e-admin
三、Create AdminController.php and add code on the yii console
<?php namespace console\controllers; class AdminController extends \yii\console\Controller { public function actionInit() { \Eadmin\Start::init([]); } public function actionFlush() { \Eadmin\Start::flush([]); } public function actionDelete($name) { \Eadmin\Start::delete($name); } }
四、Write a Model instance of the eadmin ( vendor/eddycjy/eadmin/src/Work/Model )
Yii Configuration
一、Add Backend Config Path: $APP/backend/config/main.php
Add config:
'on beforeAction' => ['Eadmin\Config', 'init'],
Demo:
return [ 'id' => 'app-backend', 'components' => [ ... ], ... 'on beforeAction' => ['Eadmin\Config', 'init'], ... ];
二、Add Console Config Path: $APP/console/config/main.php
This configuration is only used when the console is generated
Add config in components:
'session' => [ 'class' => 'yii\web\Session', ],
Demo:
return [ ... 'components' => [ 'log' => [ 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning'], ], ], ], 'session' => [ 'class' => 'yii\web\Session', ], ], ... ];
Eadmin Configuration
Add Config Path: vendor/eddycjy/eadmin/src/Config
一、Set up website information: Setting.php
二、Set up Database: Database.php
三、Set up model Autoload: Autoload.php
Generate
In the yii directory, run the following command to complete the generation
./yii admin/init
if error, you can
./yii admin/flush
or delete specified options (support modelName and runtime catalogName )
./yii admin/delete [options]
Other
- Yii
- AdminLTE
- Yii2-ueditor
- Yii2-iconpicker
- Yii2-widget-fileinput
- Yii2-widget-datepicker
- Yii2-dual-listbox
- Yii2-phpexcel
- PHPexcel
License
MIT