theodo / roger-cms-bundle

radiant CMS 的 Symfony 版本

安装: 322

依赖项: 0

建议者: 0

安全性: 0

星级: 60

关注者: 76

分支: 17

开放问题: 13

类型:symfony-bundle

1.0.0-beta2 2013-09-16 11:08 UTC

This package is not auto-updated.

Last update: 2024-09-14 12:17:26 UTC


README

警告:此包仍在开发中。尽管它功能正常,但服务名称、配置选项等可能会更改,无需担心向后兼容性中断。

安装

步骤 1:将包添加到您的项目

将 Roger 存储库添加到您的 composer.json 文件

"require": {
    "theodo/roger-cms-bundle": "dev-master"
}

然后运行

$ php composer.phar update theodo/roger-cms-bundle

步骤 2:AppKernel.php

app/AppKernel.php 中启用 TheodoRogerCmsBundle 和 StofDoctrineExtensionsBundle

public function registerBundles()
{
    $bundles = array(
        ...
        new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
        new Theodo\RogerCmsBundle\TheodoRogerCmsBundle(),
    );
}

步骤 3:更新数据库

$ php app/console doctrine:schema:update --force

步骤 4:config.yml

添加 StofDoctrineExtensions

stof_doctrine_extensions:
    orm:
        default:
            timestampable: true
            sluggable: true

步骤 5:定义 RogerCms 路由

将以下行添加到您的 app/config/routing.yml 文件中

RogerCms:
    resource: "@TheodoRogerCmsBundle/Resources/config/routing.xml"
    prefix: /

步骤 6:添加角色

app/config/security.yml 中添加 RogerCms 角色

security:

    ...

    role_hierarchy:
        ROLE_ROGER_CONTENT:   [ROLE_ROGER_READ_CONTENT, ROLE_ROGER_WRITE_CONTENT, ROLE_ROGER_DELETE_CONTENT, ROLE_ROGER_PUBLISH_CONTENT]
        ROLE_ROGER_DESIGN:    [ROLE_ROGER_READ_DESIGN, ROLE_ROGER_WRITE_DESIGN, ROLE_ROGER_DELETE_DESIGN]
        ROLE_ROGER_EDITOR:    [ROLE_ROGER_CONTENT, ROLE_ROGER_READ_DESIGN]
        ROLE_ROGER_DESIGNER:  [ROLE_ROGER_CONTENT, ROLE_ROGER_DESIGN]

        ROLE_ADMIN:           [ROLE_USER, ROLE_ROGER_DESIGNER]
        ROLE_SUPER_ADMIN:     [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
        in_memory:
            memory:
                users:
                    admin: { password: admin, roles: [ 'ROLE_ADMIN' ] }

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false

        login:
            pattern:  ^/demo/secured/login$
            security: false

        secured_area:
            pattern:    ^/demo/secured/
            form_login:
                check_path: _security_check
                login_path: _demo_login
            logout:
                path:   _demo_logout
                target: _demo

        roger_admin:
            pattern:    ^/admin
            http_basic:
                realm: "Secured Demo Area"

    ...

然后访问 /admin 并登录。

步骤 7:阅读文档

有关更多文档,请查看 Resources/doc 文件夹。