rrmontuan/yii2-materialadmin-asset
Composer 安装命令:
composer require rrmontuan/yii2-materialadmin-asset
包简介
Assets for using Material Admin Theme in Yii2 Framework
README 文档
README
Assets for using Material Admin Theme in Yii2 Framework
Backend UI for Yii2 Framework, based on Material Admin The Material Admin Template isn't free and must be purchased before using.
This package contains an Asset Bundle for Yii 2.0 Framework which registers the CSS files for the Material Admin 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 the Material Admin Asset run:
composer require rrmontuan/yii2-materialadmin-asset "^1.0"
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/rrmontuan/yii2-materialadmin-asset/example-views/yiisoft/yii2-app' ], ], ], ],
The Material Admin Asset uses the sourcePath @templates/materialadmin as default. However,if you want (or need) you can change the sourcePath reconfiguring as showed below:
'components' => [ 'assetManager' => [ 'bundles' => [ 'rrmontuan\web\MaterialAdminAsset' => [ 'sourcePath' => '@app\myfolder' ], ], ], ],
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/rrmontuan/yii2-materialadmin-asset/example-views/yiisoft/yii2-app(or other theme) to@app/views. - Remove the custom
viewconfiguration from your application by deleting the path mappings, if you have made them before.
Material Admin Plugins
Assets for Material Admin Plugins are not included in our MaterialAdminAsset but you can find all the files in the folder vendors inside the Material Admin Template folder .
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 MaterialAdminPluginAsset extends AssetBundle { public $sourcePath = '@app/templates/materialadmin'; public $js = [ // more plugin Js here ]; public $css = [ // more plugin CSS here ]; public $depends = [ 'rrmontuan\web\MaterialAdminAsset', ]; }
As this asset depends on our AdminLteAsset it's the only asset you have to register, for example in
your main.php layout file.
Left sidebar menu - Widget Menu
If you need to add more itens to the menu you can do this way:
'items'=>[ [ 'label' => 'Dashboards Slideshow', 'icon' => 'now-widgets', 'url' => ['/site/about'], 'visible' => true ], [ 'label' => 'Tables', 'icon' => 'view-list', 'url' => ['/site'], 'items' => [ ['label' => 'Normal Tables', 'url' => ['/site/contact'],], ['label' => 'Data Tables', 'url' => ['/site/index'],], ], ], ]
By default to icons will be added prefix of Material Design Icons
Template for Gii CRUD generator
Tell Gii about our template. The setting is made in the config file:
if (YII_ENV_DEV) { $config['modules']['gii'] = [ 'class' => 'yii\gii\Module', 'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'], 'generators' => [ //here 'crud' => [ 'class' => 'yii\gii\generators\crud\Generator', 'templates' => [ 'materialadmin' => '@vendor/rrmontuan/yii2-materialadmin-asset/gii/templates/crud/simple', ] ] ], ]; }
rrmontuan/yii2-materialadmin-asset 适用场景与选型建议
rrmontuan/yii2-materialadmin-asset 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.32k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「admin」 「css」 「asset」 「theme」 「backend」 「extension」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rrmontuan/yii2-materialadmin-asset 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rrmontuan/yii2-materialadmin-asset 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rrmontuan/yii2-materialadmin-asset 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Twig extension to insert css as inline styles with a tag
Caching and compression for Twig assets (JavaScript and CSS).
2lenet/EasyAdminPlusBundle
Analysis module for finding problematical shop data.
Asset for Bulma Free for YiiFramework v.3.0.
Define your own css rule-sets for the TYPO3 CMS backend.
统计信息
- 总下载量: 4.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-04-17