PHP code example of yiier / yii2-invite-code

1. Go to this page and download the library: Download yiier/yii2-invite-code library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yiier / yii2-invite-code example snippets


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

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

// ...
public $inviteCode;


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

php composer.phar 

$ php yii gcode 200

$ php yii gcode