humanized/yii2-account

提供处理用户账户的各种机制的Yii2模块

安装: 12

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

类型:yii2-extension

dev-master 2016-12-13 02:41 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:09:35 UTC


README

封装用户管理相关功能的Yii2模块。

安装

使用Composer安装

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

运行以下命令

$ php composer.phar require humanized/yii2-account "*"

或者

"humanized/yii2-account": "*"

将以下内容添加到您的 composer.json 文件的 require 部分。

运行迁移

$ php yii migrate/up --migrationPath=@vendor/humanized/yii2-account/migrations/custom

或者,如果您只想使用默认的高级应用程序模板功能

$ php yii migrate/up --migrationPath=@vendor/humanized/yii2-account/migrations/advanced-application-template/

编辑配置文件

将以下行添加到配置文件中

'modules' => [
    'translation' => [
        'class' => 'humanized\translation\Module',
    ],
],

添加这些行允许访问模块提供的各种接口。在这里,选择的模块名为translation,因此各种路由将在translation/controller-id/action-id下可用,尽管可以选择任何模块名。

此包包含一个urlManager组件,它扩展了由Codemix Yii2-LocaleUrls包提供的urlManager组件。在这里,默认应用程序语言的设置和启用网站语言的填充是自动处理的。其他配置选项在组件之间继承。

'components' => [
..
        // Languages enabled populated through database storage
        // Further configuration options available at https://github.com/codemix/yii2-localeurls 
        'urlManager' => [
            'class' => 'humanized\translation\components\UrlManager',
            'enablePrettyUrl' => true, 
            'showScriptName' => false,
        ],
..
],