Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

A simple Yii2 extension to the User component so you can get/set bits of data and store them in the session.

Notifications You must be signed in to change notification settings

aarondfrancis/yii-user-states

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

yii-user-states

A simple extension to the User component so you can get/set bits of data and store them in the session.

Set up your allowed data in User.php

private $_sessionKeys = array(
  'hairColor'
);
//	Usage: 

// set a piece of data
\Yii::$app->user->hairColor = "blonde";
echo \Yii::$app->user->hairColor;

// throws an error because the key is not present
\Yii::$app->user->eyeColor = "blue";

About

A simple Yii2 extension to the User component so you can get/set bits of data and store them in the session.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages