1. Go to this page and download the library: Download kuainiu/yii2-kuainiu 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/ */
'modules' => [
'kuainiu' => [
'class' => 'kuainiu\Module',
'tableMap' => [ // Optional, but if defined, all must be declared
'user_table' => '{{%user}}',
'username_field' => 'name',
'email_field' => 'email',
'password_hash_field' => 'password_hash',
'fullname_field' => 'chinese_name',
'avatar_field' => 'avatar',
'position_field' => 'position',
],
'profileMap' => [ // Optional, but if defined, all must be declared
'username_field' => 'name',
'email_field' => 'email',
'fullname_field' => 'chinese_name',
'avatar_field' => 'avatar',
'position_field' => 'position',
],
],
...
],
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
$this->redirect(['kuainiu/user/auth','authclient'=>'kuainiu']);
}
use kuainiu\components\KuainiuClient;
...
$client = new KuainiuClient();
$response = $client->DepartmentList(82);
use kuainiu\components\KuainiuClient;
...
$client = new FondClient();
$response = $client->DepartmentUser(82);
use kuainiu\components\KuainiuClient;
...
$client = new FondClient();
$response = $client->Notification('Allen', 'Hello World');
html
//头像
<?=Yii::$app->user->identity->avatar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.