Created
February 23, 2018 08:46
-
-
Save xiaohutai/ea8ab27aa5cfdcd1e8b972e7e38bce62 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 | |
public function onMountControllerAfter(MountEvent $event){ | |
$app = $event->getApp(); | |
foreach ($this->registerFrontendControllers() as $prefix => $collection) { | |
$event->mount($prefix, $collection); | |
} | |
if ($app['routes']->count() > 0) { | |
$nullRoute = function(){ throw new NotFoundHttpException(); }; | |
$app['controllers']->match('/', $nullRoute)->bind('preview'); | |
$app['controllers']->match('/', $nullRoute)->bind('contentlink'); | |
$app['controllers']->match('/', $nullRoute)->bind('contentlisting'); | |
$app['controllers']->match('/', $nullRoute)->bind('taxonomylink'); | |
} | |
} | |
/** {@inheritdoc} */ | |
public static function getSubscribedEvents() { | |
return [ | |
ControllerEvents::MOUNT => [ | |
['onMountControllerAfter' , -100], | |
], | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment