Last active
November 29, 2015 15:33
-
-
Save matej21/f987d925863fba7fc5cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
class SessionCleanerListener implements Kdyby\Events\Subscriber | |
{ | |
private $session; | |
public function __construct(Nette\Http\Session $session) | |
{ | |
$this->session = $session; | |
} | |
public function getSubscribedEvents() | |
{ | |
return ['Nette\Application\Application::onRequest']; | |
} | |
public function onRequest(Nette\Application\Application $app, Nette\Application\Request $request) | |
{ | |
if ($request->getPresenterName() === 'Foo' && $request->getParameter('action') === 'create') { | |
return; | |
} | |
$this->session->getSection('xyzData')->foo = NULL; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment