S2:Image

From No LJ Ads Wiki

Jump to: navigation, search

Represents an image.

[edit] Members

string alttext Default alternative text for image
string{} extra Extra params for img tag. (Read-only)
int height Height in pixels
string url URL of the image. (Read-only)
int width Width in pixels

[edit] Methods

as_string() : string Return the HTML tag for this image
as_string(string alttext) : string Return an HTML tag for this Image with given alttext
as_string(string{} opts) : string Return the HTML for an image, Supported keys are 'href' to create a link to the image source and 'a_attr' which adds attributes to the anchor tag if a link is to be printed.
print() : void Print value of Image.as_string().
print(string alttext) : void Print value of Image.as_string(string alttext).
print(string{} opts) : void Print value of Image.as_string(string{} opts).
set_url(string url) : void Sets the URL, doing any necessary escaping.