Created
February 23, 2014 19:06
-
-
Save pensiero/9175730 to your computer and use it in GitHub Desktop.
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
$application = $event->getTarget(); | |
$application->getEventManager()->attach( | |
MvcEvent::EVENT_ROUTE, | |
function (MvcEvent $event) { | |
/* @var $route Route\PageRoute */ | |
$route = $event | |
->getApplication() | |
->getServiceManager() | |
->get(__NAMESPACE__ . '\Route\PageRoute'); | |
// try catch necessario per evitare allarme in console | |
try { | |
$event->getRouter()->addRoute('cms_page', $route); | |
} catch (\Exception $event) { } | |
}, | |
1000 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment