Skip to content
This repository
tree: 8eb857b854
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 38 lines (34 sloc) 1.033 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
package view

///////////////////////////////////////////////////////////////////////////////
// Iframe

type Iframe struct {
ViewBaseWithId
Class string
Width int
Height int
Border int
Scrolling bool
MarginWidth int
MarginHeight int
Seamless bool
URL string
}

func (self *Iframe) Render(ctx *Context) (err error) {
ctx.Response.XML.OpenTag("iframe")
ctx.Response.XML.AttribIfNotDefault("id", self.id)
ctx.Response.XML.AttribIfNotDefault("class", self.Class)
ctx.Response.XML.Attrib("width", self.Width).Attrib("height", self.Height)
ctx.Response.XML.Attrib("frameborder", self.Border)
ctx.Response.XML.Attrib("marginwidth", self.MarginWidth).Attrib("marginheight", self.MarginHeight)
if self.Scrolling {
ctx.Response.XML.Attrib("scrolling", "yes")
} else {
ctx.Response.XML.Attrib("scrolling", "no")
}
if self.Seamless {
ctx.Response.XML.Attrib("seamless", "seamless")
}
ctx.Response.XML.Attrib("src", self.URL)
ctx.Response.XML.ForceCloseTag()
return nil
}
Something went wrong with that request. Please try again.