Skip to content

Commit

Permalink
uri doc finished
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheron committed Oct 18, 2017
1 parent 612cf18 commit 5e71893
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions docs/controller/uri.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The segments in a URI normally follow this pattern:

::
example.com/controller/method/param
example.com/controller/method/param1/param2...
example.com/controller/method/param1/param2

Default method
--------------
Expand All @@ -14,7 +14,7 @@ When the URL is composed of a single part, corresponding to the name of a contro

**URL :**
::
example.com/Products/1
example.com/Products

**Controller :**
::
Expand All @@ -28,7 +28,7 @@ When the URL is composed of a single part, corresponding to the name of a contro
Required parameters
-------------------

If the requested method requires parameters, they must be passed in the URL :
If the requested method requires parameters, they must be passed in the URL:

**Controller :**
::
Expand All @@ -44,4 +44,36 @@ If the requested method requires parameters, they must be passed in the URL :

Optional parameters
-------------------
The called method can accept optional parameters.\\
If a parameter is not present in the URL, the default value of the parameter is used.

**Controller :**
::
class Products extends ControllerBase{
public function sort($field,$order="ASC"){}
}

**Valid Urls :**
::
example.com/Products/sort/name
example.com/Products/sort/name/DESC

case sensitivity
----------------
On Unix systems, the name of the controllers is case-sensitive.

**Controller :**
::
class Products extends ControllerBase{
public function caseInsensitive(){}
}

**Urls :**
::
example.com/Products/caseInsensitive (valid)
example.com/Products/caseinsensitive (valid)
example.com/products/caseInsensitive (invalid since the products controller does not exist)

routing customization
---------------------
The :doc:`controller/router` and annotations of the controller classes allow you to customize URLs.

0 comments on commit 5e71893

Please sign in to comment.