mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
@@ -402,7 +402,7 @@ abstract class Route implements IRoute
|
|||||||
*/
|
*/
|
||||||
public function where(array $options)
|
public function where(array $options)
|
||||||
{
|
{
|
||||||
return $this->where($options);
|
return $this->setWhere($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -99,4 +99,16 @@ class RouterUrlTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testRegEx()
|
||||||
|
{
|
||||||
|
SimpleRouter::router()->reset();
|
||||||
|
SimpleRouter::request()->setMethod('get');
|
||||||
|
SimpleRouter::request()->setUri('/my/custom-path');
|
||||||
|
|
||||||
|
SimpleRouter::get('/my/{path}', 'DummyController@start')->where(['path' => '[a-zA-Z\-]+']);
|
||||||
|
|
||||||
|
SimpleRouter::start();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user