示例#1
0
 /**
  * set state
  * @param array $p
  */
 public function set($p)
 {
     $rez = array('success' => true);
     $state = User::getUserState();
     if (!empty($p['value']) || isset($state[$p['name']])) {
         if (empty($p['value'])) {
             unset($state[$p['name']]);
         } else {
             $state[$p['name']] = $p['value'];
         }
         User::setUserState($state);
     }
     return $rez;
 }