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. Returns- this.
- fromLocalUrl
- LinkTagBuilder fromLocalUrl(Uri localUrl)- Sets the - hrefattribute to a local URL. The URL must be mapped by BedSheet's- ClientAssetcache service. The URL may be rebuilt to take advantage of any asset caching strategies, such as Cold Feet. Returns- this.
- 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's- FileHandlerservice. The URL is built to take advantage of any asset caching strategies, such as Cold Feet. Returns- this.
- getAttr
- Returns an attribute value on the - <link>element.
- ifIe
- LinkTagBuilder ifIe(Str condition)- Wraps the - <link>element in a conditional IE comment. The given- conditionshould 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. Returns- this.
- withRel
- LinkTagBuilder withRel(Str rel)- Sets the - relattribute. Returns- this.
- withTitle
- LinkTagBuilder withTitle(Str title)- Sets the - titleattribute. Returns- this.
- withType
- LinkTagBuilder withType(MimeType type)- Sets the - typeattribute. Returns- this.