Home  >  Article  >  PHP Framework  >  How to save and obtain data in yii2 framework

How to save and obtain data in yii2 framework

王林
王林forward
2020-12-01 15:26:102332browse

How to save and obtain data in yii2 framework

The methods to save and obtain data in the yii2 framework session are as follows:

Save data

Yii::$app->session->set('user_exam', ['exam_id' => $exam_id, 'exam_type' => $exam_type]);

Get data

$this->user_exam = Yii::$app->session->get('user_exam');

Related recommendations :yii

The above is the detailed content of How to save and obtain data in yii2 framework. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete

Related articles

See more