webundle/puzzle-expertise-bundle

管理专业知识

安装: 0

依赖: 0

建议者: 0

安全: 0

星星: 0

关注者: 2

分支: 0

开放问题: 0

语言:HTML

类型:symfony-bundle

1.0.0 2019-07-10 08:44 UTC

This package is auto-updated.

Last update: 2024-09-10 20:54:30 UTC


README

基于 Symfony 项目,用于管理专业知识账户和专业知识安全的项目。

安装包

打开命令行,进入你的项目目录,执行以下命令以下载此包的最新稳定版本

composer require webundle/puzzle-expertise-bundle

步骤 1: 启用包

通过将包添加到项目 app/AppKernel.php 文件中注册的包列表中来启用 admin 包

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Puzzle\ExpertiseBundle\ExpertiseBundle(),
        );

        // ...
    }

    // ...
}

步骤 2: 配置包安全

通过将其添加到项目 app/config/security.yml 文件中来配置安全设置

security:
   	...
    role_hierarchy:
        ...
        # Expertise
        ROLE_EXPERTISE: ROLE_ADMIN
        ROLE_SUPER_ADMIN: [..,ROLE_EXPERTISE]
        
	...
    access_control:
        ...
        # Expertise
        - {path: ^%admin_prefix%expertise, host: "%admin_host%", roles: ROLE_EXPERTISE }

步骤 3: 启用包路由

通过将其添加到项目 app/config/routing.yml 文件中来注册默认路由

....
expertise:
    resource: "@ExpertiseBundle/Resources/config/routing.yml"
    prefix:   /

输入以下命令查看所有专业知识路由:php bin/console debug:router | grep expertise

步骤 4: 配置包

通过将其添加到项目 app/config/config.yml 文件中来配置 admin 包

expertise:
    contact:
        enable_mail_channel: true # false if your don't send email
        email_address: 'contact@exemple.com' # sender email
        
admin:
    ...
    modules_available: '..,expertise'
    navigation:
        nodes:
            ...
           
            # Expertise
            expertise:
                label: 'expertise.title'
                description: 'expertise.description'
                translation_domain: 'messages'
                attr:
                    class: 'fa fa-suitcase'
                parent: ~
                user_roles: ['ROLE_EXPERTISE']
            expertise_service:
                label: 'expertise.service.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_service_list'
                sub_paths: ['puzzle_admin_expertise_service_create', 'puzzle_admin_expertise_service_show', 'puzzle_admin_expertise_service_update']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']
            expertise_feature:
                label: 'expertise.feature.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_feature_list'
                sub_paths: ['puzzle_admin_expertise_feature_create', 'puzzle_admin_expertise_feature_update']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']
            expertise_project:
                label: 'expertise.project.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_project_list'
                sub_paths: ['puzzle_admin_expertise_project_create', 'puzzle_admin_expertise_project_update', 'puzzle_admin_expertise_project_show']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']
            expertise_staff:
                label: 'expertise.staff.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_staff_list'
                sub_paths: ['puzzle_admin_expertise_staff_create', 'puzzle_admin_expertise_staff_update', 'puzzle_admin_expertise_staff_show']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']
            expertise_pricing:
                label: 'expertise.pricing.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_pricing_list'
                sub_paths: ['puzzle_admin_expertise_pricing_create', 'puzzle_admin_expertise_pricing_update', 'puzzle_admin_expertise_pricing_show']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']
            expertise_partner:
                label: 'expertise.partner.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_partner_list'
                sub_paths: ['puzzle_admin_expertise_partner_create', 'puzzle_admin_expertise_partner_update']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']
            expertise_testimonial:
                label: 'expertise.testimonial.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_testimonial_list'
                sub_paths: ['puzzle_admin_expertise_testimonial_create', 'puzzle_admin_expertise_testimonial_update', 'puzzle_admin_expertise_testimonial_show']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']
            expertise_faq:
                label: 'expertise.faq.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_faq_list'
                sub_paths: ['puzzle_admin_expertise_faq_create', 'puzzle_admin_expertise_faq_update']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']
            expertise_request:
                label: 'expertise.contact.navigation'
                translation_domain: 'messages'
                path: 'puzzle_admin_expertise_contact_list'
                sub_paths: ['puzzle_admin_expertise_contact_show']
                parent: expertise
                user_roles: ['ROLE_EXPERTISE']