-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters