PHP code example of voral / joke-minimal
1. Go to this page and download the library: Download voral/joke-minimal library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
voral / joke-minimal example snippets
// app/Controllers/AboutController.php
namespace App\Controllers;
class AboutController
{
public function __invoke(): string
{
return 'About page';
}
}
use App\Controllers\AboutController;
$router->get('/about', AboutController::class);
my-app/
├── app/ # Код приложения (контроллеры, сервисы)
│ └── Controllers/
├── bootstrap/ # Инициализация фреймворка
│ └── app.php
├── public/ # Публичная точка входа
│ ├── index.php
│ └── .htaccess
├── routes/ # Определение маршрутов
│ └── web.php
└── composer.json