it-blaster/content-bundle
最新稳定版本:v1.0.3
Composer 安装命令:
composer require it-blaster/content-bundle
包简介
Symfony2 bundle for site content management, require Propel, Sonata and jstree
README 文档
README
Installation
Add to composer.json and install
{ "require": { "it-blaster/content-bundle": "dev-master" }, }
Add bundle to AppKernel.php
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Etfostra\ContentBundle\EtfostraContentBundle(), ); }
Add to routing.yml
EtfostraContentBundle: resource: . type: extra
Build models, run SQL and install assets
$ php app/console propel:model:build $ php app/console propel:migration:generate-diff $ php app/console propel:migration:migrate $ php app/console assets:install
To enable labels translation in SonataAdmin
framework: translator: { fallbacks: ["%locale%"] }
Cofigure
Edit your config.yml, add etfostra_content:
etfostra_content: page_controller_name: EtfostraContentBundle:PageFront:page page_template_name: EtfostraContentBundle:Front:default.html.twig module_route_groups: # optional, modules (routes groups) - { name: News, routes: @AcmeAppBundle/Resources/config/routing_news.yml } - { name: Catalog, routes: @AcmeAppBundle/Resources/config/routing_catalog.yml }
Debug routes
$ php app/console debug:router
Twig functions
Getting link by route name:
{{ page_path('etfostra_content_56') }}
This function return link to page by "Route Name", you can copy it from Page edit form. Function prevent exception when route not found.
Getting link by slug:
{{ page_path_by_slug('any-page-slug') }}
Generates extra query! This function return link to page by Slug, you can edit and copy it on Page edit form. Function prevent exception when route not found.
统计信息
- 总下载量: 174
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-27