mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 23:09:29 -07:00
Switch to using Plate's 'insert' method for rendering the guid pages
This commit is contained in:
parent
16ab2f640f
commit
56853211fd
2 changed files with 4 additions and 6 deletions
|
@ -109,10 +109,8 @@ if(is_array($match) && is_callable($match['target'])) {
|
||||||
|
|
||||||
case 'guideId':
|
case 'guideId':
|
||||||
$id = htmlspecialchars($match['params']['id']);
|
$id = htmlspecialchars($match['params']['id']);
|
||||||
if (file_exists("views/guides/$id.title.php")) {
|
if (file_exists("views/guides/$id.title.php") && file_exists("views/guides/$id.content.php")) {
|
||||||
$guideTitle = file_get_contents("views/guides/$id.title.php");
|
echo $templates->render('guide', ['id' => $id]);
|
||||||
$guideContent = file_get_contents("views/guides/$id.content.php");
|
|
||||||
echo $templates->render('guide', ['guide_title' => $guideTitle, 'guide_content' => $guideContent]);
|
|
||||||
} else {
|
} else {
|
||||||
echo $templates->render("404");
|
echo $templates->render("404");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php $this->layout('template.base', ['title' => $title]) ?>
|
<?php $this->layout('template.base', ['title' => $title]) ?>
|
||||||
|
|
||||||
<h1><?=$this->escape($guide_title)?></h1>
|
<h1><?php $this->insert("guides/$id.title") ?></h1>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p><a href='/guides'>Back to guides</a></p>
|
<p><a href='/guides'>Back to guides</a></p>
|
||||||
<?=$guide_content?>
|
<?php $this->insert("guides/$id.content") ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue