Skip to content

Commit

Permalink
doc URI
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheron committed Oct 17, 2017
1 parent 7324dd8 commit 612cf18
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

# General information about the project.
project = 'Ubiquity framework'
copyright = '2017, phpmv'
copyright = '2018, phpmv'
author = 'phpmv'

# The version info for the project you're documenting, acts as replacement for
Expand Down
44 changes: 42 additions & 2 deletions docs/controller/uri.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
Ubiquity URLs
=================
If you are using router with it's default behavior, there is a one-to-one relationship between a URL string and its corresponding controller class/method.
like many other frameworks, if you are using router with it's default behavior, there is a one-to-one relationship between a URL string and its corresponding controller class/method.
The segments in a URI normally follow this pattern:

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

Default method
--------------

When the URL is composed of a single part, corresponding to the name of a controller, the index method of the controller is automatically called :

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

**Controller :**
::
class Products extends ControllerBase{
public function index(){
//Default action
}
}


Required parameters
-------------------

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

**Controller :**
::
class Products extends ControllerBase{
public function display($id){}
}

**Valid Urls :**
::
example.com/Products/display/1
example.com/Products/display/10/
example.com/Products/display/ECS

Optional parameters
-------------------

2 changes: 1 addition & 1 deletion docs/createproject.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Arguments usage

short names
^^^^^^^^^^^
Example of creation of the blog project, connected to the bogDb database, with generation of all models
Example of creation of the blog project, connected to the blogDb database, with generation of all models
::
Micro new blog -b=blogDb -m=true

Expand Down

0 comments on commit 612cf18

Please sign in to comment.