classafDuvet::LinkTagBuilder
sys::Obj afDuvet::LinkTagBuilder
Defines a <link> tag to be injected into the bottom of your head.
@see https://developer.mozilla.org/en/docs/Web/HTML/Element/link
- fromExternalUrl
LinkTagBuilder fromExternalUrl(Uri scriptUrl)Sets the
hrefattribute to an external URL. Returnsthis.- fromLocalUrl
LinkTagBuilder fromLocalUrl(Uri scriptUrl)Sets the
hrefattribute to a local URL. The URL must be mapped by BedSheet'sFileHandlerservice. The URL is rebuilt to take advantage of any asset caching strategies, such as Cold Feet. Returnsthis.- fromServerFile
LinkTagBuilder fromServerFile(File scriptFile)Creates a
hrefURL attribute from the given file. The file must exist on the file system and be mapped by BedSheet'sFileHandlerservice. The URL is built to take advantage of any asset caching strategies, such as Cold Feet. Returnsthis.- getAttr
Returns an attribute value on the
<link>element.- ifIe
LinkTagBuilder ifIe(Str condition)Wraps the
<link>element in a conditional IE comment. The givenconditionshould be everything in the square brackets. Example:ifIe("if gt IE 6")would render:
<!--[if gt IE 6]> <link src="..." > <![endif]-->
- setAttr
LinkTagBuilder setAttr(Str name, Str value)Sets an arbitrary attribute on the
<link>element.- withMedia
LinkTagBuilder withMedia(Str media)Sets the
mediaattribute. Returnsthis.- withRel
LinkTagBuilder withRel(Str rel)Sets the
relattribute. Returnsthis.- withTitle
LinkTagBuilder withTitle(Str title)Sets the
titleattribute. Returnsthis.- withType
LinkTagBuilder withType(MimeType type)Sets the
typeattribute. Returnsthis.