]> _ Git - cubist_cms-back.git/commitdiff
wip #2878 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Jul 2019 19:25:24 +0000 (21:25 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Jul 2019 19:25:24 +0000 (21:25 +0200)
src/app/Http/Controllers/CubistPageController.php
src/app/Magic/Menu/PageItem.php

index 833b5252099495a137b368055f54ea0477c16c7c..6323119e6d5f07df417ba144809c7cd3396d9876 100644 (file)
@@ -25,13 +25,13 @@ class CubistPageController extends CubistFrontController
         return view('pages.' . $page->template, $this->data);
     }
 
-    public function catchall($main = '', $subs = [])
+    public function catchall($main = '', $subs = '')
     {
-        $path = trim($main . '/' . implode($subs), '/');
+
+        $path = trim($main . '/' . $subs, '/');
         if (!$path) {
             $path = 'home';
         }
-
         $nav = Menu::getNavigation();
         $item = $nav->findItemByHref($path);
         if (null === $item) {
@@ -40,6 +40,6 @@ class CubistPageController extends CubistFrontController
 
         $c = $item->getController();
 
-        redirect()->action($c['controller'] . '@' . $c['action'], $c['params']);
+        return call_user_func_array([app('App\Http\Controllers\\' . $c['controller']), $c['action']], $c['params']);
     }
 }
index d835ea070a892463aa67da4b3a49b994faa378dd..2b1c4e7c589931d1871119f0ba68f124150e12a0 100644 (file)
@@ -83,6 +83,6 @@ class PageItem extends Item
      */
     public function getController(): array
     {
-        return ['controller' => 'PageController', 'action' => 'index', 'params' => [$this->getSlug()]];
+        return ['controller' => 'PageController', 'action' => 'index', 'params' => ['slug' => $this->getSlug()]];
     }
 }