-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auto parameters disables autorendering causing a blank page #2979
Comments
I believe the issue is here, correct me if I'm wrong: https://github.com/astaxie/beego/blob/bf5c5626ab429e66d88602e1ab1ab5fbf4629a01/router.go#L951-L963 The idea is to disable the render if we have some kind of 'result' from a custom HandlerFunc (not a post, get, put, etc method). But there is no check if there is actually
with I'll open a pull request unless I'm missing something about the logic. |
…utomatic_parameter_routing fixes template rendering with automatic mapped parameters (see #2979)
Please answer these questions before submitting your issue. Thanks!
bee version
)?go 1.9.2
beego 1.9.0
What operating system and processor architecture are you using (
go env
)?darwin/amd64
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
Added an auto-parameter method to a controller instead of an empty method/Ctx.Input.Param way.
Using this:
// @router /:id [get]
func (c *MyController) Show(id int64) {
}
outputs nothing - auto template rendering is ignored. Adding c.Render() shows the expected output.
Changing it to "old way" also renders the template.
// @router /:id [get]
func (c *MyController) Show() {
id := c.Ctx.Input.Param(":id")
}
The template rendered
Nothing, 0 bytes
The text was updated successfully, but these errors were encountered: