From 01d53bd69aef482a42d5bbc94fd3496e79a97f23 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 23 Nov 2015 13:09:22 +0200 Subject: [ci skip] Update routing docs Close #4258 --- user_guide_src/source/general/routing.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst index b2c9873ab..515368099 100644 --- a/user_guide_src/source/general/routing.rst +++ b/user_guide_src/source/general/routing.rst @@ -113,18 +113,19 @@ A typical RegEx route might look something like this:: In the above example, a URI similar to products/shirts/123 would instead call the "shirts" controller class and the "id_123" method. -With regular expressions, you can also catch a segment containing a -forward slash ('/'), which would usually represent the delimiter between -multiple segments. - +With regular expressions, you can also catch multiple segments at once. For example, if a user accesses a password protected area of your web application and you wish to be able to redirect them back to the same page after they log in, you may find this example useful:: $route['login/(.+)'] = 'auth/login/$1'; +.. note:: In the above example, if the ``$1`` placeholder contains a + slash, it will still be split into multiple parameters when + passed to ``Auth::login()``. + For those of you who don't know regular expressions and want to learn -more about them, `regular-expressions.info ` +more about them, `regular-expressions.info `_ might be a good starting point. .. note:: You can also mix and match wildcards with regular expressions. -- cgit v1.2.3-24-g4f1b