Created
February 28, 2012 12:18
-
-
Save Majkl578/1932200 to your computer and use it in GitHub Desktop.
Standalone Nette\Http\Session
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 | |
use Nette\Http; | |
require $libsDir . '/Nette/loader.php'; | |
// init | |
$requestFactory = new Http\RequestFactory(); | |
$session = new Http\Session($requestFactory->createHttpRequest(), new Http\Response()); | |
// start | |
$session->start(); | |
// usage | |
$section = $session->getSection('foo'); | |
$section->bar = isset($section->bar) ? $section->bar + 1 : 1; | |
echo $section->bar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment