Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updating the README with info on the per-route configuration updates

  • Loading branch information...
commit ac4af4fa2035cd8ea0839f103124f0a04bdb93dd 1 parent a1d1718
@enygma authored
Showing with 18 additions and 0 deletions.
  1. +18 −0
@@ -128,6 +128,24 @@ You would get `Array ( [0] => /foo123 [1] => 123 )` in the `$matches` variable.
*NOTE:* DO NOT directly use the values from this array - there is currently no filtering on these values
so there is potential for exploitation.
+Bound Configuration
+You can also specify some configuration options linked directly to the route/closure combination. Here's an example:
+include_once '../Shield/Shield.php';
+$app = new Shield\Shield();
+$app->get('/xml', function() use ($app){
+ return $app->view->render('<test>this is xml</test>');
+}, array(
+ 'view.content-type' => 'text/xml'
+In the above example, we're overriding the `view.content-type` setting, but only for the `/` route, not everything. This gives us a bit more control over the application, making it easier to customize the request handling. Note this uses the dot notation to specify the value (the key). Most configuration options should be available for reconfiguration via this method.
### Shield
Please sign in to comment.
Something went wrong with that request. Please try again.