Streamline view rendering

This commit is contained in:
Tim
2023-08-15 13:37:03 +02:00
parent 45797ba20a
commit 24683e70a8
6 changed files with 37 additions and 9 deletions

View File

@ -15,7 +15,7 @@ class HelloWorldController
#[Route('/')]
public function index(): ViewInterface
{
return new BaseView('/index.php');
return new BaseView('/index');
}
#[Route('/error')]
@ -33,7 +33,7 @@ class HelloWorldController
#[Route('/view/{name}')]
public function view(string $name): ViewInterface
{
return new BaseView('/home.php', ['name' => $name]);
return new BaseView('/home', ['name' => $name]);
}
#[Route('/routes/{word}')]

View File

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