You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
797B

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Controllers;
  4. use App\ViewModels\HomeIndexViewModel;
  5. use Core\Controller;
  6. class HomeController extends Controller
  7. {
  8. public function index()
  9. {
  10. $model = new HomeIndexViewModel();
  11. $model->title = 'MindVisionCode PHP';
  12. $model->eyebrow = 'Small MVC framework';
  13. $model->message = 'A lightweight PHP MVC starter with a central dispatcher, clean controllers, SQLite-backed repositories, and readable conventions.';
  14. $model->routeExample = '/employees';
  15. return $this->view('home.index', [
  16. 'model' => $model,
  17. 'pageTitle' => $model->title,
  18. ]);
  19. }
  20. public function user(string $id)
  21. {
  22. return $this->json([
  23. 'userId' => $id,
  24. ]);
  25. }
  26. }

Powered by TurnKey Linux.