rhosocial/yii2-user

Common user model, including identity and profile.


Keywords
user, extension, social, profile, yii2, rho, log, rbac
License
Other

Documentation

rhosocial/yii2-user

Common User & Profile Models for Yii 2.

Latest Stable Version License Reference Status Build Status Dependency Status Code Coverage Scrutinizer Quality Score Code Climate

Introduction

This package consists of two models:

  • User: GUID, ID, Password Hash, IP Address, Timestamp, Password Refresh Token, Auth Key, Source, Status.
  • Profile: GUID (corresponding with GUID), Nickname, Timestamp.

Installation

The preferred way to install this extension is through composer

Either run

php composer.phar require rhosocial/yii2-user:dev-master

or add

"rhosocial/yii2-user": "dev-master"

to the require section of your composer.json

Basic Usage

Once the extension is installed, simply use it in your code by:

class User extends \rhosocial\user\User
{
    ...
}

and

class Profile extends \rhosocial\user\Profile
{
    ...
}

But the above Profile class does not contain email and phone attributes. The following SimpleProfile contains them (including corresponding rules):

class Profile extends \rhosocial\user\SimpleProfile
{
    ...
}

further detailed usage seen in here.