From fbe54fc67866ca69c404ec4b334bf0f053780d56 Mon Sep 17 00:00:00 2001 From: shoully Date: Sat, 20 Dec 2014 05:59:44 -0800 Subject: [PATCH] Created Variables (markdown) --- Variables.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Variables.md diff --git a/Variables.md b/Variables.md new file mode 100644 index 0000000..e7d2cf2 --- /dev/null +++ b/Variables.md @@ -0,0 +1,25 @@ +Flight allows you to save variables so that they can be used anywhere in your application. + + // Save your variable + Flight::set('id', 123); + + // Elsewhere in your application + $id = Flight::get('id'); + +To see if a variable has been set you can do: + + if (Flight::has('id')) { + // Do something + } + +You can clear a variable by doing: + + // Clears the id variable + Flight::clear('id'); + + // Clears all variables + Flight::clear(); + +Flight also uses variables for configuration purposes. + + Flight::set('flight.log_errors', true); \ No newline at end of file