Created
September 28, 2011 07:07
-
-
Save jwdunne/1247201 to your computer and use it in GitHub Desktop.
Request & Session usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sess = Session::init('foo'); | |
$request = Request::requires( | |
Request::GET, | |
'love' | |
); | |
/* | |
if (! isset($sess->bar)) { | |
$sess->bar = 'baz'; | |
} | |
*/ | |
if (isset($sess->bar)) { | |
echo $sess->bar; | |
} | |
// a url like ?love=1 | |
if (isset($request->love)) { | |
echo $request->love; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment