Class img

Description

[IMG] - The img class. This is an object which renders the img tag.

Located in /html-defs.php (line 3243)

RenderableObject
   |
   --StylableObject
      |
      --HTMLObject
         |
         --img
Variable Summary
 mixed $icon
 mixed $map
 mixed $target
 mixed $url
Method Summary
 img img (string $src, [string $name = ""], [string $tooltip = ""], [integer $width = false], [integer $height = false])
 void AsIcon ([string $tooltip = ""], [object $iconimage = false])
 string html ()
 string javascript ()
 void seturl (string $url, [string $target = ""])
 void set_image (string $src, [integer $width = false], [integer $height = false])
 void use_map (string $map)
 string wml ()
Variables
Methods
Constructor img (line 3267)

Constructor The src field is mandatory. The name is optional but if given it will also be used for the ALT tag. If a tooltip is not given then the name will also be used for that attribute.

NB: If the width and/or height are not given and GD is installed it will be used to find the image dimensions, otherwise these attributes will be supressed and the browser left to work it out.

img img (string $src, [string $name = ""], [string $tooltip = ""], [integer $width = false], [integer $height = false])
  • string $src: The path/URL of the image file
  • string $name: Name of the image object - also used as ALT tag
  • string $tooltip: The tooltip appears on mouseover for most browsers
  • integer $width: The width of the image in pixels
  • integer $height: The height of the image in pixels
AsIcon (line 3351)

Render the image object as an image 'icon' which can be clicked to display the object in a popup window.

void AsIcon ([string $tooltip = ""], [object $iconimage = false])
  • string $tooltip: Optional browser mouseover tooltip text
  • object $iconimage: A custom image object
html (line 3387)

Render as HTML

  • return: The image as HTML.
string html ()

Redefinition of:
RenderableObject::html()
Return output suitable for normal HTML-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to web browsers.
javascript (line 3333)

Render image as javascript object

  • return: Javascript code rendering of this image
string javascript ()
seturl (line 3317)

Set URL. When the image is clicked, the browser will target the URL. Note that this will not work if you have defined the onclick event handler.

void seturl (string $url, [string $target = ""])
  • string $url: The URL to go to when image is clicked.
  • string $target: The optional target frame, eg: '_blank' etc.
set_image (line 3288)

Set the image src and details for this image object.

void set_image (string $src, [integer $width = false], [integer $height = false])
  • string $src: The path/URL of the image file
  • integer $width: The width of the image in pixels
  • integer $height: The height of the image in pixels
use_map (line 3326)

Set image map Defines the image map to use with this image.

void use_map (string $map)
  • string $map: The name of the image map to associate with this image.
wml (line 3341)

Render as WML.

  • return: The image as WML.
string wml ()

Redefinition of:
RenderableObject::wml()
Return output suitable for normal wap-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to wap devices.

Inherited Methods

Inherited From HTMLObject

 HTMLObject::HTMLObject()
 HTMLObject::inherit_attributes()
 HTMLObject::setaccesskey()
 HTMLObject::setalign()
 HTMLObject::setalt()
 HTMLObject::setbackground()
 HTMLObject::setbgcolor()
 HTMLObject::setborder()
 HTMLObject::setcolor()
 HTMLObject::setheight()
 HTMLObject::sethspace()
 HTMLObject::setlang()
 HTMLObject::setlangdir()
 HTMLObject::setname()
 HTMLObject::setsize()
 HTMLObject::setsrc()
 HTMLObject::settabindex()
 HTMLObject::settarget()
 HTMLObject::settitle()
 HTMLObject::setvalign()
 HTMLObject::setvspace()
 HTMLObject::setwidth()
 HTMLObject::set_attribute()
 HTMLObject::set_linkover_text()
 HTMLObject::set_onblur()
 HTMLObject::set_onchange()
 HTMLObject::set_onclick()
 HTMLObject::set_ondblclick()
 HTMLObject::set_onfocus()
 HTMLObject::set_onkeydown()
 HTMLObject::set_onkeypress()
 HTMLObject::set_onkeyup()
 HTMLObject::set_onload()
 HTMLObject::set_onmousedown()
 HTMLObject::set_onmousemove()
 HTMLObject::set_onmouseout()
 HTMLObject::set_onmouseover()
 HTMLObject::set_onmouseup()
 HTMLObject::set_onselect()
 HTMLObject::set_tabindex()
 HTMLObject::taghtml()

Inherited From StylableObject

 StylableObject::StylableObject()
 StylableObject::clearstyle()
 StylableObject::setclass()
 StylableObject::setcss()
 StylableObject::setid()
 StylableObject::setstyle()

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3