symfony-utils-bundle
Symfony2 scripts and utilities., (*1)
Overview
-
{{ accept_cookies() }}
cookie privacy policy bar as a twig function
-
config/cli-config.php
configuration file for bin/doctrine
-
bin/selenium
selenium server script with all dependencies
-
bin/xbehat
behat script with gherkin i18n configuration support
Installation
Add SiciarekSymfonyUtilsBundle in your composer.json:, (*2)
{
"require": {
"siciarek/symfony-utils-bundle": "dev-master"
}
}
Now tell composer to download the bundle by running the command:, (*3)
``` bash
$ php composer.phar update siciarek/symfony-utils-bundle, (*4)
Composer will install the bundle to your project's `vendor/siciarek` directory.
Enable the bundle in the kernel:
``` php
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Siciarek\SymfonyUtilsBundle\SiciarekSymfonyUtilsBundle(),
);
}
Privacy policy bar (accept cookies)
Enable
``` yaml, (*5)
app/config/config.yml
siciarek_symfony_utils:
accept_cookies:
enabled: true
````, (*6)
Twig helper
Using default configuration values, (*7)
``` html+jinja
{{ accept_cookies() }}, (*8)
Using custom url
``` html+jinja
{{ accept_cookies('http://somedomain.com/docs/my-special-privacy-policy' }}
Default configuration
Default values, (*9)
``` yaml, (*10)
app/config/config.yml
siciarek_symfony_utils:
accept_cookies:
enabled: false
stylesheet: /bundles/siciareksymfonyutils/css/cookiesbar.css
cookie_name: cookies_accepted
privacy_policy_url: privacy-policy
template: 'SiciarekSymfonyUtilsBundle:Common:cookiesbar.html.twig', (*11)
```, (*12)