2017 © Pedro Peláez
 

yii2-extension yii2-invite-code

invite code for Yii2

image

yiier/yii2-invite-code

invite code for Yii2

  • Sunday, December 11, 2016
  • by forecho
  • Repository
  • 2 Watchers
  • 3 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 10 % Grown

The README.md

invite code for Yii2

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

invite code for Yii2, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist yiier/yii2-invite-code "*"

or add, (*5)

"yiier/yii2-invite-code": "*"

to the require section of your composer.json file., (*6)

Usage

mirage database, (*7)

$ php yii migrate --migrationPath=@yiier/inviteCode/migrations/

change config, (*8)

change console\config\main.php, (*9)

'params' => $params,
...
'controllerMap' => [
    'gcode' => [
        'class' => 'yiier\inviteCode\GCodeController',
    ]
]

console, (*10)

$ php yii gcode 200

or, (*11)

$ php yii gcode

change form view signup.php, (*12)

// ...
= $form->field($model, 'password')->passwordInput() ?>

= $form->field($model, 'inviteCode')->textInput() ?>
// ...

change SignupForm.php, (*13)

// ...
public $inviteCode;


// ...
public function rules()
{
    return [
        // ...
        ['inviteCode', 'required'],
        ['inviteCode', 'yiier\inviteCode\CodeValidator'],
    ];
}

// ...
public function signup()
{
    // ...

    // return $user->save() ? $user : null;
    // after change
    if ($user->save()) {
        InviteCode::useCode($this->inviteCode, $user->id);
        return $user;
    }
    return null;
}

The Versions

11/12 2016

dev-master

9999999-dev

invite code for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 invite code

11/12 2016

v1

1.0.0.0

invite code for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 invite code

28/04 2016

v0.2.1

0.2.1.0

invite code for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 invite code

28/04 2016

v0.2

0.2.0.0

invite code for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 invite code