public function add(PageType $pageType) { $this->pageTypes[$pageType->getId()] = $pageType; if (!($routeNames = $pageType->getRouteNames())) { return $this; } foreach ($routeNames as $routeName) { $this->pageTypesByRouteName[$routeName] = $pageType; } return $this; }
protected function registerCmsPageType() { $this->app['events']->listen('cmsable.pageTypeLoadRequested', function ($pageTypes) { $pageType = PageType::create('cmsable.admin-redirect')->setCategory('security')->setRouteScope('default')->setTargetPath('cms-redirect'); $pageTypes->add($pageType); }); }
protected function getLangKey(PageType $pageType) { return $this->langKey . '.' . str_replace('.', '/', $pageType->getId()); }