Finalize translation fixes for 13.2.md
This commit is contained in:
16
en/13.2.md
16
en/13.2.md
@@ -135,9 +135,9 @@ The application's static routes can be set like so:
|
||||
|
||||
beego.SetStaticPath("/img", "/static/img")
|
||||
|
||||
### Forwarding route
|
||||
### Forwarding routes
|
||||
|
||||
Forwarding route in the routing is based ControllerRegistor forwarding information, detailed achieve the following code shows:
|
||||
We can forward routes based on the forwarding information contained within `ControllerRegistor`. The detailed implementation can be seen in the following code snippet:
|
||||
|
||||
// AutoRoute
|
||||
func (p *ControllerRegistor) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -249,22 +249,22 @@ Forwarding route in the routing is based ControllerRegistor forwarding informati
|
||||
|
||||
### Getting started
|
||||
|
||||
After the design is based on the routing can solve the previously mentioned three restriction point, using a method as follows:
|
||||
Using our router design, we can solve the three limitations mentioned earlier. The three main use-cases are:
|
||||
|
||||
The basic use of a registered route:
|
||||
Registering route handlers:
|
||||
|
||||
beego.BeeApp.RegisterController("/", &controllers.MainController{})
|
||||
|
||||
Parameter registration:
|
||||
Handling dynamic parameters:
|
||||
|
||||
beego.BeeApp.RegisterController("/:param", &controllers.UserController{})
|
||||
|
||||
Are then matched:
|
||||
Regex matching:
|
||||
|
||||
beego.BeeApp.RegisterController("/users/:uid([0-9]+)", &controllers.UserController{})
|
||||
|
||||
## Links
|
||||
|
||||
- [Directory](preface.md)
|
||||
- Previous section: [Project program](13.1.md)
|
||||
- Next section: [Design controllers](13.3.md)
|
||||
- Previous section: [Project planning](13.1.md)
|
||||
- Next section: [Designing controllers](13.3.md)
|
||||
|
||||
Reference in New Issue
Block a user