This commit is contained in:
sermandm 2025-03-19 16:02:28 +01:00
parent cb9118d24f
commit a6ff5feb3e
5 changed files with 45 additions and 8 deletions

View File

@ -0,0 +1,11 @@
<?php
namespace Portfolio\Source\Design\Controller;
class Base
{
public function show(string $path, array $params = null)
{
}
}

View File

@ -2,12 +2,12 @@
namespace Portfolio\source\design\controller\home;
class Index
use Portfolio\Source\Design\Controller\Base;
class Index extends Base
{
public function index()
{
echo 'function index';
// return $this->show('home.index');
return $this->show('home.index');
}
}

View File

@ -2,12 +2,12 @@
namespace Portfolio\Source\Design\Controller\Home\Read;
class Read
use Portfolio\Source\Design\Controller\Base;
class Read extends Base
{
public function read(int $id)
{
echo 'post' . $id;
// return $this->show('home.read', compact(['id']));
return $this->show('home.read', compact(['id']));
}
}

25
template/base.html Normal file
View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<header>
</header>
<aside>
</aside>
<main>
{{ content }}
</main>
<footer>
</footer>
</body>
</html>

View File

@ -0,0 +1 @@
<p>content</p>