i want to only accept integers in the parameters i cant seen to get it to work my route
<?php
$router = $di->getRouter();
$router->add('/import/{([0-9]{6,8}+)}', [ 'controller' => 'import', 'action' => 'index', 'query' => 1
] ); $router->handle($_SERVER['REQUEST_URI']);
the controller
<?php
declare(strict_types=1);
class Importcontroller extends IndexController { public function indexAction() { try { $query = $this->request->getQuery("query"); var_dump($query);
} catch (Exception $e) { echo $e->getMessage(); } }
}