chaplean / cookie-bundle
Cookie Bundle 用于在网站上添加 cookie 允许信息
v4.0.1
2019-07-10 07:56 UTC
Requires
- php: >=7.1
- doctrine/doctrine-bundle: ^1.6
- doctrine/orm: ^2.5
- gkralik/php-uglifyjs: ^1.0.0
- sensio/distribution-bundle: ~5.0
- sensio/framework-extra-bundle: ^5.0.0
- symfony/monolog-bundle: ^3.0 || ^4.0
- symfony/symfony: ^3.0 || ^4.0
Requires (Dev)
- chaplean/coding-standard: 1.1.*
- chaplean/unit-bundle: ^7.0
- mockery/mockery: dev-master
- symfony/phpunit-bridge: ^4.0
This package is auto-updated.
Last update: 2024-08-29 04:49:07 UTC
README
安装
1. Composer
composer require chaplean/cookie-bundle
2. AppKernel.php
添加
new Chaplean\Bundle\CookieBundle\ChapleanCookieBundle(),
3. 设置 learn_more
在 headband 中添加 learn_more 的 URL。
app/config/config.yml
chaplean_cookie: learn_more: <your_url> translations: ~
4. 更新 assetic
在 assetic 配置中添加此捆绑包。
assetic: bundles: ['ChapleanCookieBundle']
5. 添加路由
在全局路由中包含一个路由。
app/config/routing.yml
chaplean_cookie_bundle: resource: '@ChapleanCookieBundle/Resources/config/routing.yml' prefix: /
6. 在布局中添加脚本
在布局 html 中简单地添加 me。
<script type="text/javascript" src="{{ path('chaplean_cookie_headband') }}"></script>