コード例 #1
0
ファイル: Router.php プロジェクト: un00/cldtest
 /**
  * @param Route $newRoute
  * @throws RouterException
  */
 public function add(Route $newRoute)
 {
     foreach ($this->routes as $route) {
         if ($newRoute->getMethod() == $route->getMethod() and $newRoute->getPath() == $route->getPath()) {
             throw new RouterException("Route {$route->getPath()} has already added to the route collection.");
         }
     }
     $this->routes[] = $newRoute;
 }
コード例 #2
0
ファイル: Routes.php プロジェクト: un00/cldtest
<?php

use App\Routing\Route;
return [Route::create('POST', '/getCustomers', 'CustomersController@getCustomers'), Route::create('GET', '/', 'CustomersController@index')];