phlexible/country-context-bundle
Composer 安装命令:
composer require phlexible/country-context-bundle
包简介
phlexible country context bundle
README 文档
README
The PhlexibleCountryContextBundle adds support for country-based content in phlexible.
Installation
- Download PhlexibleCountryContextBundle using composer
- Enable the Bundle
- Configure the PhlexibleCountryContextBundle
- Update your database schema
- Clear the symfony cache
Step 1: Download PhlexibleCountryContextBundle using composer
Add PhlexibleCountryContextBundle by running the command:
$ php composer.phar require phlexible/country-context-bundle "~1.0.0"
Composer will install the bundle to your project's vendor/phlexible directory.
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Phlexible\Bundle\CountryContextBundle\PhlexibleCountryContextBundle(), ); }
Step 3: Configure the PhlexibleCountryContextBundle
Now that the bundle is enabled, you need to configure the PhlexibleCountryContextBundle. Add the following configuration to your config.yaml file.
# app/config/config.yaml phlexible_country_context: countries: gb: continent: eu country: gb languages: en: {locale: en, expose: true} phlexible_tree: mediator: element_viewable_voter: "phlexible_country_context.element_mediator.country_aware_viewable_voter" router: url_generator_service: "phlexible_country_context.router.country_aware_url_generator" request_matcher_service: "phlexible_country_context.router.country_aware_request_matcher"
Step 4: Update your database schema
Now that the bundle is set up, the last thing you need to do is update your database schema because the country context bundle includes entities that need to be installed in your database.
For ORM run the following command.
$ php app/console doctrine:schema:update --force
Step 5: Clear the symfony cache
If you access your phlexible application with environment prod, clear the cache:
$ php app/console cache:clear --env=prod
统计信息
- 总下载量: 132
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-18