first import
[projectpier.git] / environment / classes / flash / flash.php
blobfccd7df752539bc2c592cde5bb860270450bb049
1 <?php
3 /**
4 * Interface to flash add method
6 * @access public
7 * @param string $name Variable name
8 * @param mixed $value Value that need to be set
9 * @return null
11 function flash_add($name, $value) {
12 Flash::instance()->addVariable($name, $value);
13 } // flash_add
15 /**
16 * Shortcut method for adding success var to flash
18 * @access public
19 * @param string $message Success message
20 * @return null
22 function flash_success($message) {
23 flash_add('success', $message);
24 } // flash_success
26 /**
27 * Shortcut method for adding error var to flash
29 * @access public
30 * @param string $message Error message
31 * @return null
33 function flash_error($message) {
34 flash_add('error', $message);
35 } // flash_error
37 /**
38 * Return variable from flash. If variable DNX NULL is returned
40 * @access public
41 * @param string $name Variable name
42 * @return mixed
44 function flash_get($name) {
45 return Flash::instance()->getVariable($name);
46 } // flash_get