Exemplo n.º 1
0
 public function setPageType(Route $route, CmsRequestInterface $request)
 {
     if (!($cmsPath = $request->getCmsPath())) {
         return;
     }
     // If a page match did happen the request already has a pagetype
     if ($cmsPath->isCmsPath()) {
         return;
     }
     if (!($pageType = $this->pageTypes->getByRouteName($route->getName()))) {
         return;
     }
     $request->getCmsPath()->setPageType($pageType);
 }
Exemplo n.º 2
0
 public function configure(Route $route, CmsRequestInterface $request)
 {
     $cmsPath = $request->getCmsPath();
     if (!($pageType = $cmsPath->getPageType())) {
         $this->resetCreator();
         $this->resetPage();
         return;
     }
     if ($node = $cmsPath->getMatchedNode()) {
         $this->setPage($node);
     } else {
         $this->resetPage();
     }
     if (!($creatorClass = $pageType->getControllerCreatorClass())) {
         $this->resetCreator();
         return;
     }
     $this->setCreator($this->container->make($creatorClass));
 }