jakharbek/jakharbek-user

jakharbek

dev-master 2017-12-04 16:59 UTC

This package is not auto-updated.

Last update: 2024-09-18 22:47:13 UTC


README

用户功能

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一

php composer.phar require --prefer-dist jakharbek/jakharbek-user "*"

或在您的 composer.json 文件的 require 部分添加

"jakharbek/jakharbek-user": "*"

使用方法

安装扩展后,您需要配置扩展;为此,您需要打开 src/bootstrap.php 并指定邮件组件和您的电子邮件

public static $mailer_component = "mailer";
public static $email_from = "";

您可以指定控制器注册的位置以及路由

public static $controllers = [
    'registration_page' => ['test/reg','reg'],
    'login_page' => ['test/login','login']
    ];

您必须指定用户和管理员模块的注册位置

public static $modules = [
    'test/admin' => 'jakharbek\user\modules\admin\Module',
    'test/user' => 'jakharbek\user\modules\user\Module'
];

您必须指定登录时重定向的位置

public static $redirect_after_login_admin = ['/test/admin'];
public static $redirect_after_login = ['/test/user'];

您必须指定登录权限

public static $premission_admin_panel = "controlPanel";

您必须提供用户和管理员个人资料的链接

public static $profile_link = '/test/user/profile/';
public static $profile_link_admin = '/test/admin/profile/';