Play around with the rendering
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
<?php /** @var $this \Ardent\Undercurrent\View\BaseView */ ?>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Base view title</title>
|
||||
</head>
|
||||
<body>
|
||||
Base, slot: <?= $this->data['slot'] ?>
|
||||
</body>
|
||||
<head>
|
||||
<title>Base view title</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="<?= $this->getRoute(\App\Controller\HelloWorldController::class, 'index') ?>">Index</a><br>
|
||||
Base slot: <br>
|
||||
<?= $this->data['slot'] ?>
|
||||
</body>
|
||||
</html>
|
@ -1,4 +1,5 @@
|
||||
<?php /** @var $this \Ardent\Undercurrent\View\BaseView */ ?>
|
||||
<?php $this->extends = '/base' ?>
|
||||
|
||||
Hello <a href="<?= $this->getRoute(\App\Controller\HelloWorldController::class, 'hello') ?>">index</a>!
|
||||
Hello world<br>
|
||||
<a href="<?= $this->getRoute(\App\Controller\HelloWorldController::class, 'routes') ?>">Routes</a>
|
||||
|
12
app/Template/routes.php
Normal file
12
app/Template/routes.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php /** @var $this \App\View\RouteView */ ?>
|
||||
|
||||
<?php
|
||||
foreach ($this->routes->getRoutes() as $route) {
|
||||
echo sprintf('<a href="%s">%s</a> - %s::%s<br>',
|
||||
$route->getRoute()->path,
|
||||
$route->getRoute()->path,
|
||||
$route->getController(),
|
||||
$route->getMethod()
|
||||
);
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user