<?php


namespace Snaju\Inception\Route\Loaders\Func;


//use Snaju\Inception\Route\Loaders\Twig\TemplateManager;
use Snaju\Inception\Route\Route;
use Snaju\Inception\Http\Request\WebRequest;
//use Snaju\Inception\Route\RouteMiddleware;

class FuncRoute extends Route
{

    protected string $routeId;

    public function __construct($pathTo, $routeId)
    {
        $this->routeId = $routeId;
        parent::__construct($pathTo);
    }

    public function onCall(WebRequest $request)
    {

//        echo '<br />';
//        echo 'FUNC ROUTE ONCALLED METHOD CALLED!!!!!!!!!';


//        $this->attach(new RouteMiddleware(function() use ($matchLoc) {
//            return require $matchLoc;
//        }));


//        $render = TemplateManager::render('/test');
//        echo $render;
//        exit;

//        if () {
//
//        }





//
//        echo "<pre>";
//        print_r($request->method());
//        echo "</pre>";
//
//
//
//
//
//        echo 'hello the functional route was called';
//        exit(200);
    }

}