Yii2 集成 adminlteasset
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的更多相关文章
- yii2集成富文本编辑器redactor
作者:白狼 出处:http://www.manks.top/article/yii2_redactor本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保 ...
- YII2集成GOAOP,实现面向方面编程!
引言: 软件开发的目标是要对世界的部分元素或者信息流建立模型,实现软件系统的工程需要将系统分解成可以创建和管理的模块.于是出现了以系统模块化特性的面向对象程序设计技术.模块化的面向对象编程极度地提高了 ...
- Yii2的相关学习记录,后台模板和gii(三)
前面已经可以正常登录,但我们需要体验下最常用的增删查改的操作.这里就需要gii,通过gii可以方便的生成表单.表格的框架,不需要我们再写重复的东西. gii访问地址:http://localhost/ ...
- Codeception 实战
Codeception 测试 Php 代码 一.一句话概述 使用 cc 进行单元测试,保证现有代码质量,为以后维护与重构提供支撑. 二.目标 安装配置 cc 编写测试代码,简化开发与最大化稳定性和可维 ...
- Yii2系列教程六:集成编辑器
上一篇文章我们实现了简单的用户权限管理,至于更先进的RBAC,我后面会单独出一篇文章来说说.在这一篇文章当中,我主要想写的是在Yii2中集成一个编辑器,因为在我们的实际开发当中,一个简单的textar ...
- YII2框架集成go!aop
AOP实践:YII2框架本身拥有一个功能,叫做行为.它可以动态的为当前的类附加额外的功能,但这种功能在代码层级结构是静态的,有侵入性的. 下面以YII2框架集成go!aop库为例,介绍在YII2中如何 ...
- yii2.0 app上集成支付宝支付
1.首先从支付宝官网下载支付宝app支付sdk 地址 : https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.hLEa5O&a ...
- yii2.0 集成/引入第三方sdk
首先下载自己要使用的sdk包放到vendor文件夹下面:我以接入ping++为例子如下: 然后在入口文件出引入文件的配置文件: 下面就是在控制器使用了: 下面就可以根据自己要使用的的文件以及方法正常调 ...
- Yii2.0 集成使用富头像上传编辑器
在开发过程中,我们会用到头像上传的功能.这里给大家推荐一款比较流行的头像上传组件,FullAvatarEditor 2.3(富头像上传编辑器). 实际效果如图所示: 1.下载组件,下载地址:http: ...
随机推荐
- linux下进程cpu占用过高问题定位方法
背景 记得前段时间,同事说他们测试环境的服务器cpu使用率一直处于100%,本地又没有什么接口调用,为什么会这样?cpu使用率居高不下,自然是有某些线程一直占用着cpu资源,那又如何查看占用cpu较高 ...
- ApacheOFBiz的相关介绍以及使用总结(三)
Ofbiz中还提供了一些基础性服务,可以直接用来使用,下面就简单介绍说明一下. ofbiz邮件发送服务 ofbiz中提供发送邮件相关功能:sendMailFromScreen contex ...
- SpringMVC+Spring+Mybatis -- 集成之旅
准备 首先介绍一下,我的工具使用的是STS, 需要的童鞋可以到官网下载:http://spring.io/tools/sts/all 使用STS是因为她集成了Maven进行 “包“ 管理以及自带 We ...
- 条件随机场(CRF)-基础
条件随机场(conditional random fields,简称 CRF,或CRFs)下文简称CRF,是一种典型的判别模型,相比隐马尔可夫模型可以没有很强的假设存在,在分词.词性标注.命名实体识别 ...
- 阶段性总结(PHP-JSON)
PHP JSON 本节我们将为大家介绍如何使用 PHP 语言来编码和解码 JSON 对象. 在没有json编码和解码之前,我们 html前台 和 PHP后台 之间的数据传输只能用字符串的方式传输. 但 ...
- Tkinter Checkbutton
Python - Tkinter Checkbutton: checkbutton小部件用于显示切换按钮的用户多项选择.然后,用户可以通过点击相应的按钮每个选项中选择一个或多个选项. checkb ...
- HALCON初步:文件夹遍历,文件筛选,文件名拆分,图片读取及保存
[1]文件夹遍历 list_image_files ( : : ImageDirectory, Extensions, Options : ImageFiles) ImageDirectory: 文件 ...
- 【源码阅读】Java集合之三 - ArrayDeque源码深度解读
Java 源码阅读的第一步是Collection框架源码,这也是面试基础中的基础: 针对Collection的源码阅读写一个系列的文章,本文是第三篇ArrayDeque. ---@pdai JDK版本 ...
- jquery中绑定click事件重复执行问题
jquery中单击事件重复多次执行的问题使用如下方式: $('#sub').unbind('click').click(function () { ... });
- python:find()函数,字符串查询
#find函数 # b中有a的元素则打印a对应的元素坐标(索引),否则打印-1 a = "abcd" b = "d" print(a.find(b))