ise / ise-module-bootstrap
该软件包已被废弃,不再维护。未建议替代包。
Internalsystemerror Limited使用的Twitter Bootstrap模块,用于Zend Framework
dev-master / 1.0.x-dev
2018-06-18 13:47 UTC
Requires
- php: ^5.6 || ^7.0
- nervo/yuicompressor: 2.4.7
- rwoverdijk/assetmanager: ^1.7
- zendframework/zend-form: ^2.5 || ^3.0
- zendframework/zend-navigation: ^2.5 || ^3.0
- zendframework/zend-view: ^2.5 || ^3.0
Requires (Dev)
- ise/php-metapackage-development: ^1.0
- zendframework/zend-i18n: ^2.6 || ^3.0
This package is auto-updated.
Last update: 2020-10-26 21:38:52 UTC
README
简介
此模块旨在将Twitter Bootstrap集成到Zend Framework 2中,并提供通用的视图辅助工具、导航视图辅助工具和表单视图辅助工具。
需求
此模块使用AssetManager,默认设置为使用YuiCompressor压缩资源。
安装
此模块的安装使用composer。
php composer.phar require ise/ise-module-bootstrap
然后,将以下模块添加到您的Zend Framework配置中。
- AssetManager
- Ise\Bootstrap
使用方法
表单视图辅助工具
以下表单视图辅助工具默认注册,可以替代由Zend Framework提供的辅助工具,并可用于替代。所有元素都将添加适当的Bootstrap样式类。
- 表单
- 表单按钮
- 表单复选框
- 表单颜色
- 表单日期
- 表单日期选择
- 表单日期时间
- 表单本地日期时间
- 表单日期时间选择
- 表单描述
- 表单元素错误
- 表单电子邮件
- 表单文件
- 表单图片
- 表单输入
- 表单月份
- 表单月份选择
- 表单多选框
- 表单数字
- 表单密码
- 表单范围
- 表单行
- 表单搜索
- 表单选择
- 表单电话
- 表单文本
- 表单时间
- 表单URL
- 表单周
以下是如何轻松渲染整个表单的示例
/** * Where $form implements Zend\Form\FormInterface */ echo $this->form($form);
视图辅助工具
通过使用DispatchListener添加Bootstrap CSS/JS和meta标签。以下视图辅助工具默认注册。
注意:时间插件使用jQuery Timeago来显示时间,例如“2分钟前”。
导航视图辅助工具
以下导航视图辅助工具默认注册。
您可以使用以下方式使用导航栏辅助工具
/** * Where $container is a valid navigation container name, such as * 'default_navigation', if using the default ZF2 navigation factory. * * To have some of the links floated to the right (a login button for instance), * you can pass in the 'rightMenu' option to point to another navigation * container instance. */ echo $this->navigation($container)->navbar()->render(null, [ 'brand' => [ 'label' => 'Your Brand Name Here', 'route' => 'home', 'icon' => 'th-large', // Or any other icon name that would be prefixed glyphicon-* ], 'inverse' => true, 'fixed' => 'top', 'rightMenu' => $anotherContainer, ]);