public function listPages($skipCache = false)
{
return Page::listInTheme($this->theme, $skipCache);
}
/** * Loads the URL map - a list of page file names and corresponding URL patterns. * The URL map can is cached. The clearUrlMap() method resets the cache. By default * the map is updated every time when a page is saved in the back-end, or * when the interval defined with the cms.urlCacheTtl expires. * @return boolean Returns true if the URL map was loaded from the cache. Otherwise returns false. */ protected function loadUrlMap() { $key = $this->getCacheKey('static-page-url-map'); $cacheable = Config::get('cms.enableRoutesCache'); $cached = $cacheable ? Cache::get($key, false) : false; if (!$cached || ($unserialized = @unserialize($cached)) === false) { /* * The item doesn't exist in the cache, create the map */ $pageList = new PageList($this->theme); $pages = $pageList->listPages(); $map = ['urls' => [], 'files' => [], 'titles' => []]; foreach ($pages as $page) { $url = $page->getViewBag()->property('url'); if (!$url) { continue; } $url = Str::lower(RouterHelper::normalizeUrl($url)); $file = $page->getBaseFileName(); $map['urls'][$url] = $file; $map['files'][$file] = $url; $map['titles'][$file] = $page->getViewBag()->property('title'); } self::$urlMap = $map; if ($cacheable) { Cache::put($key, serialize($map), Config::get('cms.urlCacheTtl', 1)); } return false; } self::$urlMap = $unserialized; return true; }