castopod/app/Helpers/page_helper.php
Yassine Doghri 9c224a8ac6 feat: add pages table to store custom instance pages (eg. legal-notice, cookie policy, etc.)
- add pages  migration, model and entity
- add page controllers
- update routes config to input page forms and page view in public
- fix markdow editor focus area
- show pages links in public side footer

closes #24
2020-10-15 14:41:34 +00:00

28 lines
595 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
*
* @return string html pages navigation
*/
function render_page_links()
{
$pages = (new PageModel())->findAll();
$links = '';
foreach ($pages as $page) {
$links .= anchor($page->link, $page->title, [
'class' => 'px-2 underline hover:no-underline',
]);
}
return '<nav class="inline-flex">' . $links . '</nav>';
}