Finds the published root pages
public static findPublishedRootPages ( array $arrOptions = [] ) : |
||
$arrOptions | array | An optional options array |
리턴 | A collection of models or null if there are no parent pages |
/** * Generates the cache mapper array. * * @param string $cacheDir The cache directory */ private function generateCacheMapper($cacheDir) { $mapper = []; $pages = PageModel::findPublishedRootPages(); if (null === $pages) { return; } while ($pages->next()) { $base = $pages->dns ?: '*'; if ($pages->fallback) { $mapper[$base . '/empty.fallback'] = $base . '/empty.' . $pages->language; } $mapper[$base . '/empty.' . $pages->language] = $base . '/empty.' . $pages->language; } $this->filesystem->dumpFile($cacheDir . '/contao/config/mapping.php', sprintf("<?php\n\nreturn %s;\n", var_export($mapper, true))); }