ppb/blog-bundle

博客组件

安装: 9

依赖者: 0

建议者: 0

安全: 0

类型:symfony-bundle

dev-master 2013-06-22 15:06 UTC

This package is auto-updated.

Last update: 2024-09-09 01:06:00 UTC


README

基于WordPress的Symfony2博客组件。

一些特性包括

  • SEO友好的URLs
  • 自定义分类法
  • 博客存档

组件安装

获取组件

添加到您的 /composer.json 文件

    "require": {
        ...
        "ppb/blog-bundle": "dev-master"
    },

并执行

composer update

注册组件

<?php

  // app/AppKernel.php
  public function registerBundles()
  {
    return array(
      // ...
      new PPB\BlogBundle\PPBBlogBundle(),
      );
  }

添加路由

在您的 routing.yml 中,您需要将后端和前端发布到您首选的路径

ppb_blog_frontend:
    resource: "@PPBBlogBundle/Controller/Frontend/"
    type:     annotation
    prefix:   /

ppb_blog_backend:
    resource: "@PPBBlogBundle/Controller/Backend/"
    type:     annotation
    prefix:   /admin

设置变量

您需要在您的 config.yml 中添加类似以下内容

ppb_blog:
    post_types:
        post:
            name: Post
            slug: post
            supports: [title, content]
        page:
            name: Page
            slug: page
            supports: [title, content, parent]
    taxonomies:
        category:
            name: Category
            slug: category
            object_type: [post]
        tag:
            name: Tag
            slug: tag
            object_type: [post, page]

联系方式

您可以通过 twitter 与我联系。