castopod/app/Helpers/page_helper.php
Yassine Doghri 40a0535fc1 feat(public-ui): adapt public podcast and episode pages to wireframes
- adapt wireframes with responsive design
- refactor models methods to cache requests for faster queries
- update public controllers to cache pages while retaining analytics hits
- add platform links to podcast page
- add previous / next episodes in episode page
- update npm packages to latest versions

closes #30, #13
2020-10-15 14:41:43 +00:00

31 lines
743 B
PHP

<?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
use App\Models\PageModel;
/**
* Returns instance pages as links inside nav tag
*
* @param string $class
* @return string html pages navigation
*/
function render_page_links($class = null)
{
$pages = (new PageModel())->findAll();
$links = anchor(route_to('home'), lang('Common.home'), [
'class' => 'px-2 underline hover:no-underline',
]);
foreach ($pages as $page) {
$links .= anchor($page->link, $page->title, [
'class' => 'px-2 underline hover:no-underline',
]);
}
return '<nav class="' . $class . '">' . $links . '</nav>';
}