Skip to content

Commit c18ce4f

Browse files
mtnrbqKrzysztof-Cieslak
authored andcommitted
Add new renderXml to render XmlNode based templates (#32)
1 parent 5bd3229 commit c18ce4f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Saturn/ControllerHelpers.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ module ControllerHelpers =
3232
let render (ctx: HttpContext) template =
3333
ctx.WriteHtmlStringAsync template
3434

35+
///Returns to the client rendered xml template.
36+
let renderXml (ctx: HttpContext) template =
37+
ctx.WriteHtmlStringAsync (Giraffe.GiraffeViewEngine.renderXmlNode template)
38+
3539
///Returns to the client static file.
3640
let file (ctx: HttpContext) path =
3741
ctx.WriteHtmlFileAsync path

0 commit comments

Comments
 (0)