Bonjour les amis,
Ce que je fais
Décrivez ici votre code ou ce que vous cherchez à faire
<?php
require '../vendor/autoload.php';
$router = new AltoRouter();
define('VIEW_PATH', dirname(__DIR__).'/views');
$router->map('GET', '/blog',function(){
require VIEW_PATH . '/post/index.php';
});
$router->map('GET', '/blog/category', function(){
require VIEW_PATH . '/category/shows.php';
});
$match = $router->match();
$match['target']();
Ce que je veux
Décrivez ici ce que vous cherchez à obtenir
Ce que j'obtiens
Notice: Trying to access array offset on value of type bool in C:\xampp\htdocs\TPblog\public\index.php on line 15
Fatal error: Uncaught Error: Function name must be a string in C:\xampp\htdocs\TPblog\public\index.php:15 Stack trace: #0 {main} thrown in C:\xampp\htdocs\TPblog\public\index.php on line 15