承接 it-blaster/content-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Build Status Scrutinizer Code Quality

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

GitHub 信息

  • Stars: 1
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-27