chaplean/cookie-bundle

Cookie Bundle 用于在网站上添加 cookie 允许信息

安装次数: 2

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 3

语言:CSS

类型:symfony-bundle

v4.0.1 2019-07-10 07:56 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>