mirror of https://github.com/flightphp/core
parent
37a2fd5d9d
commit
fbe54fc678
@ -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);
|
Loading…
Reference in new issue