You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require_once "../vendor/autoload.php";
use Phroute\Phroute\RouteCollector;
use Phroute\Phroute\Exception\HttpRouteNotFoundException;
use Phroute\Phroute\Exception\HttpMethodNotAllowedException;
$router = new RouteCollector();
$router->get('/', ['App\Controllers\HomeController', 'index']);
$dispatcher = new Phroute\Phroute\Dispatcher($router->getData());
try {
$response = $dispatcher->dispatch($_SERVER['REQUEST_METHOD'], parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
} catch (HttpRouteNotFoundException $e) {
die(var_dump($e));
} catch (HttpMethodNotAllowedException $e) {
die(var_dump($e));
}
echo $response;
HomeController.php
namespace App\Controllers;
class HomeController
{
public function index()
{
return "Hello";
}
}
every time i make a request to any of the endpoints, the controller method is called twice. Has anyone encounter this issue? if so, how did you solve it?
output
debug back_trace
The text was updated successfully, but these errors were encountered:
bootstrap.php
HomeController.php
every time i make a request to any of the endpoints, the controller method is called twice. Has anyone encounter this issue? if so, how did you solve it?
output
debug back_trace
The text was updated successfully, but these errors were encountered: