|
@@ -36,7 +36,6 @@ Router::connect('/', 'Pages::view');
|
|
|
*/
|
|
*/
|
|
|
Router::connect('/pages/{:args}', 'Pages::view');
|
|
Router::connect('/pages/{:args}', 'Pages::view');
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* Add the testing routes. These routes are only connected in non-production environments, and allow
|
|
* Add the testing routes. These routes are only connected in non-production environments, and allow
|
|
|
* browser-based access to the test suite for running unit and integration tests for the Lithium
|
|
* browser-based access to the test suite for running unit and integration tests for the Lithium
|
|
@@ -48,15 +47,13 @@ if (!Environment::is('production')) {
|
|
|
Router::connect('/test', array('controller' => 'lithium\test\Controller'));
|
|
Router::connect('/test', array('controller' => 'lithium\test\Controller'));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-/* This is the login and logout routes */
|
|
|
|
|
|
|
+/* These are the login and logout routes */
|
|
|
Router::connect('/login', array('controller' => 'users', 'action' => 'login'));
|
|
Router::connect('/login', array('controller' => 'users', 'action' => 'login'));
|
|
|
Router::connect('/logout', array('controller' => 'users', 'action' => 'logout'));
|
|
Router::connect('/logout', array('controller' => 'users', 'action' => 'logout'));
|
|
|
|
|
|
|
|
//Pagination route
|
|
//Pagination route
|
|
|
Router::connect('/{:controller}/{:action}/page:{:page:[0-9]+}');
|
|
Router::connect('/{:controller}/{:action}/page:{:page:[0-9]+}');
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* Define an anonymous function that we will pass to the router instead of linking to a controller action
|
|
* Define an anonymous function that we will pass to the router instead of linking to a controller action
|
|
|
* The logic is quite simple:
|
|
* The logic is quite simple:
|
|
@@ -92,7 +89,7 @@ The regex is quite simple even if it looks complex:
|
|
|
(?P<foo>) is for setting up a named capture group. This equals doing {:foo:{pattern}} in Lithium.
|
|
(?P<foo>) is for setting up a named capture group. This equals doing {:foo:{pattern}} in Lithium.
|
|
|
So we have 1 capture group named {id} that have to match by 24 signs (mongoid), and an optional part "_{width}x{height}" and finally the filtype.
|
|
So we have 1 capture group named {id} that have to match by 24 signs (mongoid), and an optional part "_{width}x{height}" and finally the filtype.
|
|
|
|
|
|
|
|
-Im unsure if the keys array can be handled some other way, but it failed for me without it.
|
|
|
|
|
|
|
+I'm unsure if the keys array can be handled some other way, but it failed for me without it.
|
|
|
*/
|
|
*/
|
|
|
$imageHandlingOptions = array(
|
|
$imageHandlingOptions = array(
|
|
|
'handler' => $imageSizer,
|
|
'handler' => $imageSizer,
|
|
@@ -105,8 +102,6 @@ Finally we connect this as a route. The regex sent as the first param here is ov
|
|
|
*/
|
|
*/
|
|
|
Router::connect('/image/{:id:[0-9a-f]{24}}.jpg', array(), $imageHandlingOptions);
|
|
Router::connect('/image/{:id:[0-9a-f]{24}}.jpg', array(), $imageHandlingOptions);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* ### Database object routes
|
|
* ### Database object routes
|
|
|
*
|
|
*
|
|
@@ -142,4 +137,4 @@ Router::connect('/{:controller}/{:action}/{:id:[0-9a-f]{24}}');
|
|
|
*/
|
|
*/
|
|
|
Router::connect('/{:controller}/{:action}/{:args}');
|
|
Router::connect('/{:controller}/{:action}/{:args}');
|
|
|
|
|
|
|
|
-?>
|
|
|
|
|
|
|
+?>
|