]> git.andy128k.dev Git - routeexpression.git/commitdiff
update examples
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 22 Jun 2013 08:00:29 +0000 (11:00 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 22 Jun 2013 08:00:29 +0000 (11:00 +0300)
README.org

index 48a55ddc88a1d71a856f896c350cc477d4a9e1b5..d631221d9d03d845b7ce06fb469a5bfa4778216d 100644 (file)
    
    This method returns ~true~ on successfull match of ~$url~ and matched parts in ~$matches~ array.
 
-   Example: ~RouteExpression::compile('[/ru]/story/')->match('/story/', $matches);~ returns ~true~ and ~$matches~ contains empty string which corresponds to optional part of expression.
+   Examples.
+
+   ~RouteExpression::compile('[/ru]/story/')->match('/story/', $matches)~ returns ~true~ and ~$matches~ contains empty string which corresponds to optional part of expression.
+
+   ~RouteExpression::compile('/article/:slug')->match('/article/php-is-awesome', $matches)~ returns ~true~ and ~$matches~ contains ~'php-is-awesome'~.
 
 ** Reversing
     
@@ -47,3 +51,7 @@
 
    This method substitutes values from ~$matches~ array to the expression and returns url.
 
+   Example.
+
+   ~RouteExpression::compile('/article/:slug')->reverse(array('/article/php-is-awesome')~ returns ~'/article/php-is-awesome'~.
+