/** * Get the page object by url * * @param string $url requested url * * @return boolean|object */ public function getPageByUrl($url) { $objUrl = new \Cx\Core\Routing\Url($url); $result = $this->pageRepo->getPagesAtPath($this->langName . '/' . $objUrl->getSuggestedTargetPath(), null, $this->langId, false); if ($result['page']) { return $result['page']; } return false; }
/** * Check if the page is module or content page * * @param string $url requested url * * @return boolean|object */ public function isModulePage($url) { try { $url = new \Cx\Core\Routing\Url($url); $path = $url->getSuggestedTargetPath(); } catch (\Exception $e) { $path = ''; } $result = $this->pageRepo->getPagesAtPath($this->langName . '/' . $path, null, $this->langId, false, \Cx\Core\ContentManager\Model\Repository\PageRepository::SEARCH_MODE_PAGES_ONLY); if ($result['page']) { return $result['page']; } return false; }