v
v copied to clipboard
Return rendered template file with Context.html() result is error
V version: V 0.2.4 d4b3c65.cfecb62 OS: linux, Linux version 5.14.13-200.fc34.x86_64
What did you do?
['/admin/test']
pub fn (mut app App) admin_test() vweb.Result {
mut x := $tmpl('templates/admin/test_template.html')
return app.Context.html(x)
// Error: cannot use vweb.Result as type string in return argument
return x
// Error: '{' expected (got ";")
}
What did you expect to see? The function should return the rendered file content in html format
What did you see instead? The errors above, even if the template file is an empty file