diff --git a/routing/conditions.rst b/routing/conditions.rst index 2e0d34b2da3..b7574dd2158 100644 --- a/routing/conditions.rst +++ b/routing/conditions.rst @@ -17,6 +17,8 @@ define arbitrary matching logic, use the ``conditions`` routing option: path: /contact controller: 'App\Controller\DefaultController::contact' condition: "context.getMethod() in ['GET', 'HEAD'] and request.headers.get('User-Agent') matches '/firefox/i'" + # expressions can also include config parameters + # condition: "request.headers.get('User-Agent') matches '%app.allowed_browsers%'" .. code-block:: xml @@ -30,6 +32,8 @@ define arbitrary matching logic, use the ``conditions`` routing option: App\Controller\DefaultController::contact context.getMethod() in ['GET', 'HEAD'] and request.headers.get('User-Agent') matches '/firefox/i' + + @@ -50,6 +54,8 @@ define arbitrary matching logic, use the ``conditions`` routing option: array(), array(), 'context.getMethod() in ["GET", "HEAD"] and request.headers.get("User-Agent") matches "/firefox/i"' + // expressions can also include config parameters + // 'request.headers.get("User-Agent") matches "%app.allowed_browsers%"' )); return $collection;