定制 alpixel/userbundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

alpixel/userbundle

Composer 安装命令:

composer require alpixel/userbundle

包简介

FOSUserBundle integration to Sonata & ALPIXEL tools

README 文档

README

SensioLabsInsight Build Status StyleCI Scrutinizer Code Quality Latest Stable Version

The AlpixelUserBundle is an integration of FOSUserBundle + Sonata admin for ALPIXEL projects.

It comes bundled with 2 main entity :

  • An abstract BaseUser which should be used to create your main user entity in the project
  • An admin entity extending the BaseUser to create administrator
  • Fixtures for the admin entity

Installation

  • Install the package
composer require 'alpixel/userbundle:~2.0'
  • Update AppKernel.php

    <?php
    // app/AppKernel.php

    // ...
    class AppKernel extends Kernel
    {
        public function registerBundles()
        {
            $bundles = array(
                // ...

                new Alpixel\Bundle\UserBundle\AlpixelUserBundle(),
            );

            // ...
        }

        // ...
    }
  • Update DB Schema
php app/console doctrine:schema:update
  • Create a User entity in your AppBundle extending the BaseUser
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Alpixel\Bundle\UserBundle\Entity\User as BaseUser;


/**
 * @ORM\Entity
 * @ORM\Table(name="account_user")
 */
class User extends BaseUser
{

    /**
     * @var integer
     *
     * @ORM\Column(name="user_id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

}
  • Add the routing
admin:
    resource: '@AlpixelUserBundle/Resources/config/routing.yml'
  • Change security.yml (optionnal)

If you have more than an admin firewall, you should copy the security.yml of the bundle and paste it in your main security.yml to edit it.

  • Customize login page

For every firewall you have to specify a template for the login page. The admin login template is always provided. Otherwise, it should be defined using the alpixel_user.firewall_templates parameters :

alpixel_user:
    firewall_templates:
        admin:
            login_template: 'AlpixelUserBundle:admin:pages/back_login.html.twig'

You can also simply change the color and the background image of the admin page by overriding these parameters

alpixel_user:
    default_login_background_image: '../../bundles/alpixeluser/img/background.jpg'
    default_login_background_color: '#ff656c'

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固