Add ViewHelper in view for injecting some basic classes in views

This commit is contained in:
Tim
2023-08-15 12:10:04 +02:00
parent de5ff3a2b9
commit 45797ba20a
12 changed files with 61 additions and 22 deletions

View File

@ -1,10 +1,10 @@
<?php /** @var $this \Ardent\Undercurrent\View\BaseView */ ?>
<html>
<html lang="en">
<head>
<title>TOSTI MAN KOMT JE HALEN</title>
<title>Base view title</title>
</head>
<body>
<?= $this->data['slot'] ?>
Base, slot: <?= $this->data['slot'] ?>
</body>
</html>

View File

@ -1,4 +1,4 @@
<?php /** @var $this \Ardent\Undercurrent\View\BaseView */ ?>
<?php $this->extends = '/Template/base.php' ?>
<?php $this->extends = '/base.php' ?>
<?= $this->data['message'] ?>
Hello <?= $this->data['name'] ?>!

4
app/Template/index.php Normal file
View File

@ -0,0 +1,4 @@
<?php /** @var $this \Ardent\Undercurrent\View\BaseView */ ?>
<?php $this->extends = '/base.php' ?>
Hello <a href="<?= $this->helper->getRoute(\App\Controller\HelloWorldController::class, 'hello') ?>">index</a>!