youra-halloween/yii2-material-design-components
Composer 安装命令:
composer require youra-halloween/yii2-material-design-components
包简介
Components can be used in php or in conjunction with the yii2 framework.
README 文档
README
Components can be used in php or in conjunction with the yii2 framework.
The project can be supported by money, beer, burger, clothes and your motorcycle. Thank you 😎
Demos
MDC Template
MDC Google Components Page
To generate a new template use MDC Template
To generate a color scheme Color tool
Google MDC version used v.10
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist youra-halloween/yii2-material-design-components "^0.4.0"
or add
"youra-halloween/yii2-material-design-components": "^0.4.0"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
/** * Main backend application asset bundle. */ class MainAsset extends AssetBundle { public $depends = [ 'yh\mdc\assets\YhAsset', ]; }
If you use YhAsset, then JS and CSS scripts are included. Separately JS can be connected using MdcJsAsset.
UtilsAsset will connect scripts for working with forms and tables and asynchronous xhr requests.
Examples
Add textfield username and password
use yh\mdc\ActiveForm; use yh\mdc\components\TextField; $form->field($model, 'username')->textInput([ 'tabIndex' => 1, 'autocomplete' => 'username', 'required' => true, 'property' => [ 'autoFocus' => true, 'label' => Yii::t('backend/login', 'Введите логин'), 'labelTemplate' => TextField::ALIGN_TOP, 'labelSize' => Vars::LARGE, 'textSize' => Vars::LARGE, 'helper' => Yii::t('backend/login', 'email | логин'), 'height' => Vars::LARGE ], ]) $form->field($model, 'password')->passwordInput([ 'tabIndex' => 2, 'autocomplete' => 'current-password', 'required' => true, 'property' => [ 'label' => Yii::t('backend/login', 'Введите пароль'), 'labelTemplate' => TextField::ALIGN_TOP, 'labelSize' => Vars::LARGE, 'textSize' => Vars::LARGE, 'icons' => [ ['icon' => 'visibility', 'role' => 'button', 'toggle' => 'visibility_off'] ], 'helper' => '', 'height' => Vars::LARGE ]]) /** * role - can be icon or button * toggle - when you click on the button, change the icon */ 'icons' => [ ['icon' => 'visibility', 'role' => 'button', 'toggle' => 'visibility_off'] ],
Add gray button
Button::one(Yii::t('backend/login', 'Войти'), ['spinner' => Button::SP_AUTO], ['tabIndex' => 4]) ->setOwner($form) ->gray() ->submit()
Add menu
Menu::one([ 'id' => 'locale-menu', 'items' => I18nLocale::getList() ])->render() //Where I18nLocale::getList() returns an associative array // OR Menu::one([ 'id' => 'app-user-menu', 'items' => [ [ 'text' => Yii::t('backend/main/user-menu', 'Настройки профиля'), 'separator' => true ], [ 'text' => Yii::t('backend/main-user-menu', 'Выход'), 'href' => Url::to('main/logout'), 'options' => [ 'data' => ['method' => 'post'] ] ], ] ]) ->render()
Add snackbar
Snackbar::one('') ->setProperty(['closeButton'=> Yii::t('backend', 'Закрыть')]) ->setId('app-snackbar') ->render()
See the use of JS components here
By Google
youra-halloween/yii2-material-design-components 适用场景与选型建议
youra-halloween/yii2-material-design-components 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 01 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「components」 「extension」 「yii2」 「material-design」 「google-components」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 youra-halloween/yii2-material-design-components 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 youra-halloween/yii2-material-design-components 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 youra-halloween/yii2-material-design-components 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
UI Kit 3 Extension for Yii2
Adds more BBCode
Web Font Loader gives you added control when using linked fonts via @font-face.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-20