You are viewing revision #4 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version or see the changes made in this revision.
Yii2 comes with a charming twitter bootstrap version 3. But if it is less, then you can integrate with web templates that you like. One example is wonderfull template "adminLTE" http://almsaeedstudio.com/AdminLTE/
With Yii2 we can do it easily, the following steps
- Download adminLTE of http://almsaeedstudio.com/AdminLTE/
- extract to a directory, @ app \ web \
- Change the folder name becomes "adminlte"
- Change AppAsset.php located in the directory @ app \ assets \
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace backend\assets;
use yii\web\AssetBundle;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/site.css',
'adminlte/css/AdminLTE.css', // THIS CHANGE
];
public $js = [
'adminlte/js/AdminLTE/app.js' // THIS CHANGE
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
- Finish Now look at the results :)
Demo
http://www.yii2-heart.hafidmukhlasin.com/
username: admin
password: admin
Demo layout
Very nice!
It would be great if you could write a short article about how you built the layout of the demo.
Thanks for your work!
How about Yii 1
It is fantastic!!
could I integrate Yii 1.1.X with fantastic theme AdminLTE? If yes, then how?
Issue with yii2 advanced backend theme
Hi,
I have installed yii2 advanced,and I want to change backend theme.
I followed your instruction,but nothing changed,
Is there any file where I need to tell yii2 that use adminlte theme?
checkbox problem in Gridview of AdminLTE
using this theme if i use checkboxes in gridview then clicking on header checkbox the checkboxs for the remaining records cannot be selected.
Issue with yii2 advanced backend theme
@Muhammad Shahzad
Tutorial updated. It should solve your problem now.
problems installing theme
hi! I'm trying to install adminlte theme following guide but it can run... :(
How extends the css?
Please, how can i customize the AdminLTE.css?
Update AssetBundle path
probably this page must be updated.
I try a fresh Admin-lte installation and the right AssetBundle is:
class AppAsset extends AssetBundle { public $sourcePath = '@bower/'; public $css = ['admin-lte/dist/css/AdminLTE.css']; public $js = ['admin-lte/dist/js/app.js']; public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapAsset', 'yii\bootstrap\BootstrapPluginAsset', ]; }
Hi,
I've changed the AppAsset.php. But don't understand what to do next. Can anyone please tell step by step with file name. I don't know how to do these two: "check to referring it in your views/layouts/main.php" and "Change your views adhering to html markup vendor/bower/admin-lte/pages". I'm new in Yii2. Please help if anyone can.
Regards,
Siddique
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.