kr-solutions/krcms-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

kr-solutions/krcms-bundle

最新稳定版本:1.3.10

Composer 安装命令:

composer require kr-solutions/krcms-bundle

包简介

Content Management System bundle for symfony 2

README 文档

README

Content Management System for integration in (existing) Symfony 3 projects.

Easy to connect with your own security and user management (bundle).

Installation

Step 1: Composer

Add KRSolutionsKRCMSBundle to your composer.json

{
    "require": {
        "kr-solutions/krcms-bundle": "~1",
    }
}

also add component-dir under config node of composer.json

{
    "config": {
        "component-dir": "web/assets"
    }
}

Now tell composer to download the bundle by running the command:

composer update kr-solutions/krcms-bundle

Step 2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new KRSolutions\Bundle\KRCMSBundle\KRSolutionsKRCMSBundle(),
        new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
        new FM\ElfinderBundle\FMElfinderBundle(),
        // ...
    );
}

Step 3: Import KRSolutionsKRCMSBundle routing files

Problably before all your other routing, but after your security routing, insert:

(you can change the prefix, but remember to use the same prefix in the next step (security.yml)).

# app/config/routing.yml
kr_solutions_krcms_admin:
    resource: "@KRSolutionsKRCMSBundle/Resources/config/routing_admin.yml"
    prefix:   /cms

kr_solutions_krcms:
    resource: "@KRSolutionsKRCMSBundle/Resources/config/routing.yml"
    prefix:   /

Step 4: Configure your application's security.yml

Secure the CMS with access_control, you can use your own roles here:

# app/config/security.yml
security:

    //....
    access_control:
        //....
        - { path: ^/cms/, role: ROLE_USER }

Step 5: Minimal configuration

This bundle needs to know which user class to use for cms users. This can be your own, using your own login screens etc.

This user class has to have an identifier field called 'id' for it's relationships. If you are using another primary field name: bad luck. Try to change it or fork this bundle.

# app/config/config.yml

# Enable the translator
parameters:
    locale: en

framework:
    #....
    translator:      { fallbacks: ["%locale%"] }
    #....

# KRSolutionsKRCMSBundle configuration
kr_solutions_krcms:
    db_driver: orm # Currently only the orm driver is supported
    model:
        user_class: AppBundle\Entity\User

Step 6: Install assets & update the database schema

php bin/console assets:install --relative
php bin/console doctrine:schema:update --force

Optional: Implement custom username implementation for display in this CMS

The system is trying to find out the username for display in the CMS by trying to get the following methods from the user class:

  • getKRCMSUsername()
  • getUsername()
  • getId()

统计信息

  • 总下载量: 211
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-16