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

How to save and obtain data in yii2 framework

王林
Release: 2020-12-01 15:26:10
forward
2375 people have browsed it

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]);
Copy after login

Get data

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

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template