adamlundrigan / ldc-user-profile
ZfcUser的用户配置扩展
1.2.1
2015-01-24 01:50 UTC
Requires
- zf-commons/zfc-user: 1.*
Requires (Dev)
- fabpot/php-cs-fixer: @stable
- mockery/mockery: ~0.9
- phpunit/phpunit: ~4.1
This package is not auto-updated.
Last update: 2024-09-24 01:05:43 UTC
README
是什么?
LdcUserProfile是一个可扩展的用户配置系统,用于ZfcUser。它允许认证用户修改自己的账户配置。
如何?
-
安装Composer包
composer require adamlundrigan/ldc-user-profile:1.*@stable
-
在您的ZF2应用程序中启用模块(
LdcUserProfile
)。 -
收益!用户配置页面默认挂载在URL路径
/user/profile
。
给我看看!
如果您幸运地在一个具有PHP >=5.4和pdo_sqlite
的*nix系统上,请进入demo
文件夹并运行设置脚本(run.sh
)。这将构建演示应用程序,安装示例配置扩展模块,并启动一个web服务器。完成后,只需打开您的浏览器并
- 导航到
https://:8080/user/register
- 创建账户
- 导航到
https://:8080/user/profile
更改模块配置
您可以通过将发行版配置文件复制到您的ZF2应用程序的config/autoload
文件夹中,并删除.dist
后缀来覆盖LdcUserProfile的配置。现在您可以在其中修改配置变量以更改LdcUserProfile的行为!
禁用字段的编辑
使用配置覆盖,您可以指定每个扩展中哪些字段是可编辑的。例如,要允许用户仅更改ZfcUser扩展中的显示名称和密码,您需要在ldc-user-profile.global.php.dist
文件中放入以下内容
'validation_group_override' => array(
'zfcuser' => array(
'display_name
'password',
'passwordVerify',
),
),
提供给validation_group_override
的结构直接传递到Form::setValidationGroup
以启用指定的表单字段。
添加自定义扩展
捆绑的演示模块ExtensionModule
提供了一个如何实现自己的配置扩展的简洁示例。