Add HTML no template string output support #197

This commit is contained in:
Javier Provecho Fernandez
2015-03-08 17:50:58 +01:00
parent bee03fa7b0
commit cf8150ed2b
2 changed files with 22 additions and 0 deletions
+5
View File
@@ -351,6 +351,11 @@ func (c *Context) String(code int, format string, values ...interface{}) {
c.Render(code, render.Plain, format, values)
}
// Writes the given string into the response body and sets the Content-Type to "text/html" without template.
func (c *Context) HTMLString(code int, format string, values ...interface{}) {
c.Render(code, render.HTMLPlain, format, values)
}
// Returns a HTTP redirect to the specific location.
func (c *Context) Redirect(code int, location string) {
if code >= 300 && code <= 308 {