v icon indicating copy to clipboard operation
v copied to clipboard

Return rendered template file with Context.html() result is error

Open aviadb opened this issue 4 years ago • 0 comments

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

aviadb avatar Oct 27 '21 20:10 aviadb