Minimal core. No magic. Just your code.
e(), multiple layouts
.env, constant definition
App/ ├── Config/ │ └── routes.php # route definitions ├── Controllers/ │ └── NanofwController.php ├── Core/ # framework core │ ├── App.php │ ├── Controller.php │ ├── Csrf.php │ ├── EnvLoader.php │ ├── HttpException.php │ ├── Request.php │ ├── Response.php │ ├── Router.php │ ├── Session.php │ └── View.php ├── Models/ ├── views/ │ ├── layouts/ │ │ ├── main.php # main layout │ │ └── blank.php # clean passthrough │ └── partials/ │ ├── head.php │ └── meta.php # all meta tags (OG, Twitter, SEO, PWA…) ├── bootstrap.php # application bootstrap └── .env # environment config public/ ├── index.php # single entry point └── .htaccess
App/Config/routes.php'GET' => [
'/' => [HomeController::class, 'index'],
'/about' => [HomeController::class, 'about'],
'/post/(:num:id)' => [BlogController::class, 'show'],
]
App/Controllers/class HomeController extends Controller
{
public function index(): Response
{
return $this->view('home', ['title' => 'Home']);
}
}
App/views/home.php<h1><?= e($title) ?></h1> <p>This is my first view.</p>