Last active
August 29, 2015 14:06
-
-
Save 0xMatt/d6be86ce44f24fc2ec11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use LaravelCms\Mvc\Resolver; | |
/* | |
|-------------------------------------------------------------------------- | |
| Application Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register all of the routes for an application. | |
| It's a breeze. Simply tell Laravel the URIs it should respond to | |
| and give it the Closure to execute when that URI is requested. | |
| | |
*/ | |
$resolver = new Resolver(Request::path()); | |
if($resolver->route()) | |
{ | |
$method = $resolver->getMethod(); | |
$dispatch = rtrim($resolver->getNamespace(), "\\") . '\\' . ucfirst($resolver->getController()) . 'Controller' . '@' . $resolver->getAction(); | |
#dd($dispatch); // string '\System\Controllers\Frontend\HomeController@index' (length=49) | |
// Example: | |
// URI: / | |
// Creates: Route::get('/', '\System\Controllers\Frontend\HomeController@index'); | |
Route::$method($resolver->getRoute(), $dispatch); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment