chaplean / outdated-browser-bundle
过时浏览器组件
v4.0.1
2019-07-10 07:33 UTC
Requires
- php: >=7.1
- gkralik/php-uglifyjs: ^1.0.0
- incenteev/composer-parameter-handler: ^2.0
- jms/security-extra-bundle: ^1.5
- sensio/distribution-bundle: ^5.0
- sensio/framework-extra-bundle: ^3.0 || ^4.0 || ^5.0
- symfony/assetic-bundle: ^2.3
- symfony/symfony: ^3.0 || ^4.0
Requires (Dev)
- chaplean/codeship-scripts: ^1.0
- chaplean/coding-standard: ^1.1
- chaplean/unit-bundle: ^7.0
- mockery/mockery: dev-master
- sensio/generator-bundle: ^3.0
- symfony/phpunit-bridge: ^4.0
This package is auto-updated.
Last update: 2024-09-26 06:23:23 UTC
README
1. 在 AppKernel 中添加我
app/AppKernel.php
... /** * @return array */ public function registerBundles() { return array( ... new Chaplean\Bundle\OutdatedBrowserBundle\ChapleanOutdatedBrowserBundle(), ); } ...
2. 定义配置(可选)
app/config/config.yml
# default option chaplean_outdated_browser: background_color: '#f25648' color: '#ffffff' lower_than: 'transform' template: 'ChapleanOutdatedBrowserBundle:Template:outdated.html.twig'
lower_than
可以取
- "IE11","borderImage"
- "IE10", "transform"(默认属性)
- "IE9", "boxShadow"
- "IE8", "borderSpacing"
3. 更新 assetic
在 assetic 配置中添加此组件
assetic: bundles: ['ChapleanOutdatedBrowserBundle']
4. 添加路由
在全局路由中包含路由
app/config/routing.yml
chaplean_outdated_browser_bundle: resource: "@ChapleanOutdatedBrowserBundle/Resources/config/routing.yml" prefix: /
5. 在布局中添加脚本
在布局 html 中简单添加我
未压缩版本
<script type="text/javascript" src="{{ path('chaplean-outdated-browser.js') }}"></script>
压缩版本
<script type="text/javascript" src="{{ path('chaplean-outdated-browser.min.js') }}"></script>