eee
This commit is contained in:
@@ -28,14 +28,12 @@ class Delete extends AbstractRequestMethod implements InjectMethodInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(string $class, string $method): void
|
public function dispatch(string $class, string $method): void
|
||||||
{
|
{
|
||||||
$controller = \Kiri::getDi()->get($class);
|
|
||||||
|
|
||||||
// TODO: Implement dispatch() method.
|
// TODO: Implement dispatch() method.
|
||||||
$path = '/' . ltrim($this->path, '/');
|
$path = '/' . ltrim($this->path, '/');
|
||||||
if (!empty($this->version)) {
|
if (!empty($this->version)) {
|
||||||
$path = '/' . trim($this->version) . $path;
|
$path = '/' . trim($this->version) . $path;
|
||||||
}
|
}
|
||||||
Router::addRoute(RequestMethod::REQUEST_DELETE, $path, [$controller, $method]);
|
Router::addRoute(RequestMethod::REQUEST_DELETE, $path, [$class, $method]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,14 +28,12 @@ class Get extends AbstractRequestMethod implements InjectMethodInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(string $class, string $method): void
|
public function dispatch(string $class, string $method): void
|
||||||
{
|
{
|
||||||
$controller = \Kiri::getDi()->get($class);
|
|
||||||
|
|
||||||
// TODO: Implement dispatch() method.
|
// TODO: Implement dispatch() method.
|
||||||
$path = '/' . ltrim($this->path, '/');
|
$path = '/' . ltrim($this->path, '/');
|
||||||
if (!empty($this->version)) {
|
if (!empty($this->version)) {
|
||||||
$path = '/' . trim($this->version) . $path;
|
$path = '/' . trim($this->version) . $path;
|
||||||
}
|
}
|
||||||
Router::addRoute(RequestMethod::REQUEST_GET, $path, [$controller, $method]);
|
Router::addRoute(RequestMethod::REQUEST_GET, $path, [$class, $method]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,13 +29,12 @@ class Head extends AbstractRequestMethod implements InjectMethodInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(string $class, string $method): void
|
public function dispatch(string $class, string $method): void
|
||||||
{
|
{
|
||||||
$controller = Kiri::getDi()->get($class);
|
|
||||||
// TODO: Implement dispatch() method.
|
// TODO: Implement dispatch() method.
|
||||||
$path = '/' . ltrim($this->path, '/');
|
$path = '/' . ltrim($this->path, '/');
|
||||||
if (!empty($this->version)) {
|
if (!empty($this->version)) {
|
||||||
$path = '/' . trim($this->version) . $path;
|
$path = '/' . trim($this->version) . $path;
|
||||||
}
|
}
|
||||||
Router::addRoute(RequestMethod::REQUEST_HEAD, $path, [$controller, $method]);
|
Router::addRoute(RequestMethod::REQUEST_HEAD, $path, [$class, $method]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,14 +30,12 @@ class Options extends AbstractRequestMethod implements InjectMethodInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(string $class, string $method): void
|
public function dispatch(string $class, string $method): void
|
||||||
{
|
{
|
||||||
$controller = Kiri::getDi()->get($class);
|
|
||||||
|
|
||||||
// TODO: Implement dispatch() method.
|
// TODO: Implement dispatch() method.
|
||||||
$path = '/' . ltrim($this->path, '/');
|
$path = '/' . ltrim($this->path, '/');
|
||||||
if (!empty($this->version)) {
|
if (!empty($this->version)) {
|
||||||
$path = '/' . trim($this->version) . $path;
|
$path = '/' . trim($this->version) . $path;
|
||||||
}
|
}
|
||||||
Router::addRoute(RequestMethod::REQUEST_OPTIONS, $path, [$controller, $method]);
|
Router::addRoute(RequestMethod::REQUEST_OPTIONS, $path, [$class, $method]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,13 +30,11 @@ class Post extends AbstractRequestMethod implements InjectMethodInterface
|
|||||||
public function dispatch(string $class, string $method): void
|
public function dispatch(string $class, string $method): void
|
||||||
{
|
{
|
||||||
// TODO: Implement dispatch() method.
|
// TODO: Implement dispatch() method.
|
||||||
$controller = Kiri::getDi()->get($class);
|
|
||||||
|
|
||||||
$path = '/' . ltrim($this->path, '/');
|
$path = '/' . ltrim($this->path, '/');
|
||||||
if (!empty($this->version)) {
|
if (!empty($this->version)) {
|
||||||
$path = '/' . trim($this->version) . $path;
|
$path = '/' . trim($this->version) . $path;
|
||||||
}
|
}
|
||||||
Router::addRoute(RequestMethod::REQUEST_POST, $path, [$controller, $method]);
|
Router::addRoute(RequestMethod::REQUEST_POST, $path, [$class, $method]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,13 +32,12 @@ class Put extends AbstractRequestMethod implements InjectMethodInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(string $class, string $method): void
|
public function dispatch(string $class, string $method): void
|
||||||
{
|
{
|
||||||
$controller = Kiri::getDi()->get($class);
|
|
||||||
// TODO: Implement dispatch() method.
|
// TODO: Implement dispatch() method.
|
||||||
$path = '/' . ltrim($this->path, '/');
|
$path = '/' . ltrim($this->path, '/');
|
||||||
if (!empty($this->version)) {
|
if (!empty($this->version)) {
|
||||||
$path = '/' . trim($this->version) . $path;
|
$path = '/' . trim($this->version) . $path;
|
||||||
}
|
}
|
||||||
Router::addRoute(RequestMethod::REQUEST_PUT, $path, [$controller, $method]);
|
Router::addRoute(RequestMethod::REQUEST_PUT, $path, [$class, $method]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,11 +28,10 @@ class Route extends AbstractRequestMethod implements InjectMethodInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(string $class, string $method): void
|
public function dispatch(string $class, string $method): void
|
||||||
{
|
{
|
||||||
$controller = \Kiri::getDi()->get($class);
|
|
||||||
$path = '/' . ltrim($this->path, '/');
|
$path = '/' . ltrim($this->path, '/');
|
||||||
if (!empty($this->version)) {
|
if (!empty($this->version)) {
|
||||||
$path = '/' . trim($this->version) . $path;
|
$path = '/' . trim($this->version) . $path;
|
||||||
}
|
}
|
||||||
Router::addRoute([$this->method], $path, [$controller, $method]);
|
Router::addRoute([$this->method], $path, [$class, $method]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user