1 | <?php |
||
28 | class SessionHelper extends Helper |
||
29 | { |
||
30 | /** |
||
31 | * Constructor |
||
32 | * |
||
33 | * @param \Cake\View\View $View The View this helper is being attached to. |
||
34 | * @param array $config Configuration settings for the helper. |
||
35 | */ |
||
36 | public function __construct(View $View, array $config = []) |
||
45 | |||
46 | /** |
||
47 | * Reads a session value for a key or returns values for all keys. |
||
48 | * |
||
49 | * In your view: |
||
50 | * ``` |
||
51 | * $this->Session->read('Controller.sessKey'); |
||
52 | * ``` |
||
53 | * Calling the method without a param will return all session vars |
||
54 | * |
||
55 | * @param string|null $name The name of the session key you want to read |
||
56 | * @return mixed Values from the session vars |
||
57 | */ |
||
58 | public function read($name = null) |
||
62 | |||
63 | /** |
||
64 | * Checks if a session key has been set. |
||
65 | * |
||
66 | * In your view: |
||
67 | * ``` |
||
68 | * $this->Session->check('Controller.sessKey'); |
||
69 | * ``` |
||
70 | * |
||
71 | * @param string $name Session key to check. |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function check($name) |
||
78 | |||
79 | /** |
||
80 | * Event listeners. |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public function implementedEvents() |
||
88 | } |
||
89 |