classafDuvet::LinkTagBuilder
sys::Obj afDuvet::LinkTagBuilder
Defines a <link> tag to be injected into the bottom of your head. Autobuild or create via HtmlInjector.
If defining a stylesheet, note that any Content-Security-Policy response header will be updated to ensure it can be loaded.
@see https://developer.mozilla.org/en/docs/Web/HTML/Element/link
- fromExternalUrl
LinkTagBuilder fromExternalUrl(Uri externalUrl)Sets the
hrefattribute to an external URL. Returnsthis.- fromLocalUrl
LinkTagBuilder fromLocalUrl(Uri localUrl)Sets the
hrefattribute to a local URL. The URL must be mapped by BedSheet'sClientAssetcache service. The URL may be rebuilt to take advantage of any asset caching strategies, such as Cold Feet. Returnsthis.- fromServerFile
LinkTagBuilder fromServerFile(File serverFile)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.