MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mstate.class
Ir para a documentação deste ficheiro.
1<?php
2class MState
3{
5 var $viewState = '';
6
7 function __construct()
8 {
9 $this->stateVars = array
10 (
11 );
12
13 $this->viewState = '';
14 }
15
16 function set($var, $value, $component_name = '')
17 {
18
19 if (!$component_name)
20 {
21 $this->stateVars[$var] = $value;
22 }
23 else
24 {
25 $this->stateVars[$component_name][$var] = $value;
26 }
27 }
28
29 function get($var, $component_name = '')
30 {
31
32 if (!$component_name)
33 {
34 return $this->stateVars[$var] ?? null;
35 }
36 else
37 {
38 return $this->stateVars[$component_name][$var];
39 }
40 }
41
42 function LoadViewState()
43 {
44 $this->viewState = $_POST['__VIEWSTATE'] ?? null;
45
46 if ($this->viewState)
47 {
48 $s = base64_decode($this->viewState);
49 $this->stateVars = unserialize($s);
50 }
51 }
52
53 function SaveViewState()
54 {
55 if ($this->stateVars)
56 {
57 $s = serialize($this->stateVars);
58 $this->viewState = base64_encode($s);
59 }
60 }
61
62 function GetViewState()
63 {
64 return $this->viewState;
65 }
66}
67?>
__construct()
Definição mstate.class:7
SaveViewState()
Definição mstate.class:53
LoadViewState()
Definição mstate.class:42
GetViewState()
Definição mstate.class:62
$viewState
Definição mstate.class:5
$stateVars
Definição mstate.class:4