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. supervisor 管理

    Supervisor是用Python开发的一套通用的进程管理程序,能将一个普通的命令行进程变为后台daemon,并监控进程状态,异常退出时能自动重启.它是通过fork/exec的方式把这些被管理的进程 ...

  2. Shell教程快速入门

    Shell即是一种命令语言,又是一种程序设计语言,使用者可以通过Shell访问操作系统的内核服务. Shell编程和java.python.C一样,只要一个能编写代码的文本编辑器和一个能解释执行的脚本 ...

  3. MongoDB day01

    MongoDB芒果数据库 数据存储阶段 文件管理阶段(.txt .doc .xlc) 优点:数据可以长期保存:数据有一定格式化规范:可以大量存储:使用简单方便 缺点:数据一致性差:用户查找修改不方便: ...

  4. node的超时timeout

    如果在指定的时间内服务器没有做出响应(可能是网络间连接出现问题,也可能是因为服务器故障或网络防火墙阻止了客户端与服务器的连接),则响应超时,同时触发http.ServerResponse对象的time ...

  5. 导出ExcelDemo

    public String exportExcel(){ String message=null; SimpleDateFormat df =new SimpleDateFormat("yy ...

  6. hdu1010 Tempter of the Bone(深搜+剪枝问题)

    Tempter of the Bone Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Submission( ...

  7. FreeRADIUS 、DaloRADIUS 搭建记录

    一.  安装环境 系统环境:centos6.5 IP:192.168.30.242 hostname:vpn.org 软件:PPTP.LAMP均已安装.(请确保这些正常安装,并能使用). 二.  软件 ...

  8. Idea2016远程调试Java项目

    一.在IDEA中配置远程tomcat 1.打开配置页面 选择"+" → "Tomcat Server" → "Remote" 填写名称和目标 ...

  9. IAR安装破解教程

    主要讲解IAR软件安装及破解使用 1.下载安装包.注册机 2.点击安装程序 ~ 点击第二个选项进行安装 ~ 然后一直next,再选择安装路径 继续next开始安装,等个五分钟左右即可安装完成 2.破解 ...

  10. C# 泛型编程之泛型类、泛型方法、泛型约束

    来自Hauk的文章 C# 泛型编程之泛型类.泛型方法.泛型约束 所谓泛型,即通过参数化类型来实现在同一份代码上操作多种数据类型. 泛型编程是一种编程范式,它利用“参数化类型”将类型抽象化,从而实现更为 ...