Xiao-Hu Tai
2018-02-23T08:46:18Z

BoltExtensionOverrideRoutes.php

| <?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],
| ],
| ];
| }