https://github.com/dmstr/yii2-adminlte-asset

AdminLTE Asset Bundle

Backend UI for Yii2 Framework, based on AdminLTE

"Yii2 AdminLTE Presentation"

This package contains an Asset Bundle for Yii 2.0 Framework which registers the CSS files for the AdminLTE user-interface.

The CSS files are installed via Yii's recommended usage of the fxp/composer-asset-plugin v1.1.1 or later.

Installation

The preferred way to install this extension is through composer.

To install AdminLTE v2 run:

php composer.phar require dmstr/yii2-adminlte-asset "2.*"
To install AdminLTE v1 run: php composer.phar require dmstr/yii2-adminlte-asset "1.*"
Quick Start Once the extension is installed, you can have a preview by reconfiguring the path mappings of the view component: For Yii 2 Advanced Application Template or Basic Application Template 'components' => [
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app'
],
],
],
],
For Phundament 4 'components' => [
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/phundament/app'
],
],
],
],
This asset bundle provides sample files for layout and view (see folder examples/), they are not meant to be customized directly in the vendor/ folder. Therefore it is recommended to copy the views into your application and adjust them to your needs. Customization Copy files from vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app (or other theme) to @app/views.
Remove the custom view configuration from your application by deleting the path mappings, if you have made them before.
Edit your views adhering to html markup vendor/almasaeed2010/adminlte/pages
AdminLTE Plugins Assets for AdminLTE plugins are not included in our AdminLteAsset but you can find these files in your vendor directory under vendor/almasaeed2010/adminlte/plugins. So if you want to use any of them we recommend to create a custom bundle where you list the plugin files you need: use yii\web\AssetBundle;
class AdminLtePluginAsset extends AssetBundle
{
public $sourcePath = '@vendor/almasaeed2010/adminlte/plugins';
public $js = [
'datatables/dataTables.bootstrap.min.js',
// more plugin Js here
];
public $css = [
'datatables/dataTables.bootstrap.css',
// more plugin CSS here
];
public $depends = [
'dmstr\web\AdminLteAsset',
];
}
As this asset depends on our AdminLteAsset it's the only asset you have to register, for example in your main.php layout file. Skins By default the extension uses blue skin for AdminLTE. You can change it in config file. 'components' => [
'assetManager' => [
'bundles' => [
'dmstr\web\AdminLteAsset' => [
'skin' => 'skin-black',
],
],
],
],
And then just replace class of body skin-blue. You can use AdminLteHelper::skinClass() if you don't want to alter every view file when you change skin color. <body class="<?= \dmstr\helpers\AdminLteHelper::skinClass() ?>">
Note: Use AdminLteHelper::skinClass() only if you override the skin through configuration. Otherwise you will not get the correct css class of body. Here is the list of available skins: "skin-blue",
"skin-black",
"skin-red",
"skin-yellow",
"skin-purple",
"skin-green",
"skin-blue-light",
"skin-black-light",
"skin-red-light",
"skin-yellow-light",
"skin-purple-light",
"skin-green-light"
If you want to use native DOM of headers AdminLTE <h1>
About <small>static page</small>
</h1>
then you can follow the code: /* @var $this yii\web\View */ $this->params['breadcrumbs'][] = 'About'; $this->beginBlock('content-header'); ?>
About <small>static page</small>
<?php $this->endBlock(); ?> <div class="site-about">
<p> This is the About page. You may modify the following file to customize its content: </p>
<code><?= __FILE__ ?></code>
</div>
Left sidebar menu - Widget Menu If you need to separate sections of the menu then just add the li.header item to items 'items' => [
['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii']],
['label' => 'Debug', 'icon' => 'fa fa-dashboard', 'url' => ['/debug']],
['label' => 'MAIN NAVIGATION', 'options' => ['class' => 'header']], // here
// ... a group items
['label' => '', 'options' => ['class' => 'header']],
// ... a group items
['label' => '', 'options' => ['class' => 'header']],
// ... a group items
To add a label for a item: 'items' => [
[
'label' => '<span>Mailbox</span><span class="pull-right-container"><small class="label pull-right bg-yellow">' . $mailCount . '</small></span>',
'icon' => 'fa fa fa-envelope-o',
'url' => ['/mailbox'],
'encode' => false,
],
Further Information For AdminLTE documentation, please read https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html Namespacing rules follow the Yii 2.0 framework structure, eg. dmstr\web for the Asset Bundle.

  

Yii2 集成 adminlteasset的更多相关文章

  1. yii2集成富文本编辑器redactor

    作者:白狼 出处:http://www.manks.top/article/yii2_redactor本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保 ...

  2. YII2集成GOAOP,实现面向方面编程!

    引言: 软件开发的目标是要对世界的部分元素或者信息流建立模型,实现软件系统的工程需要将系统分解成可以创建和管理的模块.于是出现了以系统模块化特性的面向对象程序设计技术.模块化的面向对象编程极度地提高了 ...

  3. Yii2的相关学习记录,后台模板和gii(三)

    前面已经可以正常登录,但我们需要体验下最常用的增删查改的操作.这里就需要gii,通过gii可以方便的生成表单.表格的框架,不需要我们再写重复的东西. gii访问地址:http://localhost/ ...

  4. Codeception 实战

    Codeception 测试 Php 代码 一.一句话概述 使用 cc 进行单元测试,保证现有代码质量,为以后维护与重构提供支撑. 二.目标 安装配置 cc 编写测试代码,简化开发与最大化稳定性和可维 ...

  5. Yii2系列教程六:集成编辑器

    上一篇文章我们实现了简单的用户权限管理,至于更先进的RBAC,我后面会单独出一篇文章来说说.在这一篇文章当中,我主要想写的是在Yii2中集成一个编辑器,因为在我们的实际开发当中,一个简单的textar ...

  6. YII2框架集成go!aop

    AOP实践:YII2框架本身拥有一个功能,叫做行为.它可以动态的为当前的类附加额外的功能,但这种功能在代码层级结构是静态的,有侵入性的. 下面以YII2框架集成go!aop库为例,介绍在YII2中如何 ...

  7. yii2.0 app上集成支付宝支付

    1.首先从支付宝官网下载支付宝app支付sdk 地址 : https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.hLEa5O&a ...

  8. yii2.0 集成/引入第三方sdk

    首先下载自己要使用的sdk包放到vendor文件夹下面:我以接入ping++为例子如下: 然后在入口文件出引入文件的配置文件: 下面就是在控制器使用了: 下面就可以根据自己要使用的的文件以及方法正常调 ...

  9. Yii2.0 集成使用富头像上传编辑器

    在开发过程中,我们会用到头像上传的功能.这里给大家推荐一款比较流行的头像上传组件,FullAvatarEditor 2.3(富头像上传编辑器). 实际效果如图所示: 1.下载组件,下载地址:http: ...

随机推荐

  1. 27 mysql主从出现错误

    大多数的互联网应用场景都是读多写少,在发展过程中可能会出现读性能问题,在数据库层解决读性能问题:一主多从 下面是多主从结构 虚线箭头表示主备关系,A与A’互为主备,从库B,C,D指向主库A,一主多从的 ...

  2. 【BZOJ】2007: [Noi2010]海拔(平面图转对偶图)

    题目 传送门:QWQ 分析 左上角是0,右下角是1.那么大概整张图是由0 1构成的. 那么我们要找到0和1的分界线,值就是最小割. 然后变成求原图最小割. 考虑到此题是平面图,那么就转成对偶图跑最短路 ...

  3. Thread pools & Executors

    Thread pools & Executors Run your concurrent code in a performant way All about thread pools # H ...

  4. java基础循环

    一. while循环 示例1:.循环打印1到10之间的值 public class Test1 { public static void main(String[] args) { int i=1;/ ...

  5. PHP5.3安装Zend Guard Loader代替Zend Optimizer

    Zend Optimizer/3.3.3   解密加代码优化,提高PHP应用程序的执行速度,显著降低服务器的CPU负载. Zend Guard Loader/5.5.0/6.0   解密加代码优化,提 ...

  6. ad采样后幅度的衰减

    adc采集到的信号对低频有一定的衰减.因为要确定衰减的程度.通过da输出到示波器上观察. 数据如下: 输入 输出(enable) 输出(disable) 1v(20hz) 1v 0.88v 1v(10 ...

  7. 关于sencha touch中给文本添加焦点无效的解决方案

    目前的解决方案是给你的执行代码加上一个timeout延迟100ms+ setTimeout(function(){ SoftKeyboard.isShowing(function(isShowing) ...

  8. microtip Tooltip工具提示样式

    最近开发项目,想增加滑动提示文字,类似img alt和i的title,但是效果都不是很理想,当然jq也有,但是用起来比较繁琐,使用不是特别方便 于是在github上看到了一个不错的库: https:/ ...

  9. window.location和window.open的区别

    window.location = "http://www.baidu.com" 跳转后有后退功能 window.location.replace("http://www ...

  10. VC6.0打开文件是卡死的解决办法

    删除工程目录下的 .ncb .opt 文件,然后就OK了!