<?php
namespace backend\modules\user\controllers;

use Yii;

class InfoController extends BaseController
{
    public function actionIndex()
    {
        $this->view->title = '个人资料';
        $memberInfo = Yii::$app->user->identity;
        $memberInfo['gender'] = $memberInfo['gender'] == 1 ? '男' : ($memberInfo['gender'] == 2 ? '女' : '未知');
        $memberInfo['birthday'] = date('Y-m-d', strtotime($memberInfo['birthday']));
        return $this->render('index', [
            'memberInfo' => $memberInfo,
        ]);
    }
}