Fixes #347, Fixes #401 - Allow user routes to be registered before the CMS

This commit is contained in:
Sam Georges 2014-07-12 13:16:16 +10:00
parent a19cd6f76b
commit 04bbad320f
3 changed files with 30 additions and 15 deletions

View File

@ -67,8 +67,8 @@ if (!isset($unitTesting) || !$unitTesting) {
header('Cache-Control: pre-check=0, post-check=0, max-age=0, max-stale = 0', false); // HTTP/1.1
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Expires: 0', false);
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Expires: 0', false);
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Pragma: no-cache');
}

View File

@ -1,12 +1,20 @@
<?php
/*
* Back-end routes
* Register Backend routes before all user routes.
*/
App::before(function($request) {
/*
* Other pages
*/
Route::group(['prefix' => Config::get('cms.backendUri', 'backend')], function() {
Route::any('{slug}', 'Backend\Classes\BackendController@run')->where('slug', '(.*)?');
});
/*
* Entry point
*/
Route::any(Config::get('cms.backendUri', 'backend'), 'Backend\Classes\BackendController@run');
Route::group(['prefix' => Config::get('cms.backendUri', 'backend')], function() {
Route::any('{slug}', 'Backend\Classes\BackendController@run')->where('slug', '(.*)?');
});
Route::any(Config::get('cms.backendUri', 'backend'), 'Backend\Classes\BackendController@run');

View File

@ -1,12 +1,19 @@
<?php
/*
* Combine JavaScript and StyleSheet assets
* Register CMS routes before all user routes.
*/
Route::any('combine/{file}', 'Cms\Classes\Controller@combine');
App::before(function($request) {
/*
* The CMS module intercepts all URLs that were not
* handled by the back-end modules.
*/
Route::any('{slug}', 'Cms\Classes\Controller@run')->where('slug', '(.*)?');
/*
* Combine JavaScript and StyleSheet assets
*/
Route::any('combine/{file}', 'Cms\Classes\Controller@combine');
/*
* The CMS module intercepts all URLs that were not
* handled by the back-end modules.
*/
Route::any('{slug}', 'Cms\Classes\Controller@run')->where('slug', '(.*)?');
});