adamlundrigan / ldc-user-profile
User profile extension for ZfcUser
Installs: 2 428
Dependents: 0
Suggesters: 1
Security: 0
Stars: 6
Watchers: 6
Forks: 4
Open Issues: 6
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-11-19 01:58:16 UTC
README
What?
LdcUserProfile is an extensible user profile system for ZfcUser. It allows the authenticated user to modify their own account profile.
How?
-
Install the Composer package:
composer require adamlundrigan/ldc-user-profile:1.*@stable
-
Enable the module (
LdcUserProfile
) in your ZF2 application. -
Profit! The user profile page is mounted on the URL path
/user/profile
by default.
Show me!
If you're fortunate enough to be on a *nix system with PHP >=5.4 and pdo_sqlite
, pop into the demo
folder and run the setup script (run.sh
). This will build the demo application, install the example profile extension module, and start a webserver. Once that's all done just open your browser and:
- Navigate to
http://localhost:8080/user/register
- Create an account
- Navigate to
http://localhost:8080/user/profile
Changing module configuration
You can override the configuration of LdcUserProfile by copying the dist config file into the config/autoload
folder of your ZF2 application and dropping the .dist
suffix. Now you can modify the configuration variables within to change the behavior of LdcUserProfile
!
Disabling editing of fields
Using the configuration override you can specify which fields in each extension are editable. For example, to allow only the user to change their display name and password in the ZfcUser extension you would put this in the ldc-user-profile.global.php.dist
file:
'validation_group_override' => array(
'zfcuser' => array(
'display_name
'password',
'passwordVerify',
),
),
The structure provided to validation_group_override
is fed directly into Form::setValidationGroup
to enable only the specified form fields.
Adding custom extensions
The bundled demo module ExtensionModule
provides a succinct example of how to implement your own profile extension.