Class WFImage

Description

An Image widget for our framework.

This widget allows you to easily display an image on your page.

The PATH for the image is created from concatenating the base dir and the image path (value). There are separate properties and bindings available for each because this adds flexibility in displaying images that are based on dynamic data. Plus, no image will be rendered if value is blank, even if baseDir is non-blank.

If only one of width or height is supplied, the image will be proportionally resized with CSS.

The "value" for WFImage is the image URL to include. The baseDir attribute will be pre-pended.

PHOCOA Builder Setup:

Required:

Optional:

Located in /framework/widgets/WFImage.php (line 43)

WFObject
   |
   --WFView
      |
      --WFWidget
         |
         --WFImage
Variable Summary
string $align
string $alt
string $baseDir
integer $border
boolean $fitToBox
integer $height
string $link
string $linkTarget
integer $width
Method Summary
static void exposedProperties ()
WFImage __construct ( $id,  $page)
void render ([ $blockContent = NULL])
void setBaseDir (string $path)
Variables
string $align (line 64)
  • var: The HTML align string. Default "". One of left, right, top, bottom, middle, baseline, etc.
  • access: protected
string $alt (line 68)
  • var: The HTML alt string. Default "".
  • access: protected
string $baseDir (line 48)
  • var: The base dir for the image path stored in value. Example: /images/products/previews/small/. Note that the value will be concatenated directly to this string with no '/' or other characters added. Thus be sure to include a trailing slash if your baseDir is truly a directory. This property should have probably been named basePath. Now that PHOCOA supports ValuePattern binding construction, baseDir is not as relevant as it used to be, except in the situation where you want to supply your baseDir programmatically.
  • access: protected
integer $border (line 60)
  • var: The border to use (css-style: 1px solid blue). Default 0.
  • access: protected
string $filesystemBasePath (line 97)
  • var: OPTIONAL "base" path for the filesystemPath attribute. The two properties will be concatenated to create the full path.
  • access: protected
string $filesystemPath (line 93)
  • var: The filesystem path to the image.
  • access: protected
boolean $fitToBox (line 89)
  • var:

    If true, fit the image to the box specified by width and height.

    The image will be scaled proportionally.

    If only one of width or height is specified, the image will be scaled to fit that dimension only.

    Requires that the filesystemPath property exist.

    If any error conditions occur, will throw an exception.

  • access: protected
integer $height (line 56)
  • var: The height in pixels of the image.
  • access: protected
string $link (line 72)
  • var: The url of the link to surround the image with.
  • access: protected
string $linkTarget (line 76)
  • var: The HTML "target" attribute of the link.
  • access: protected
integer $width (line 52)
  • var: The width in pixels of the image.
  • access: protected

Inherited Variables

Inherited from WFWidget

WFWidget::$bindings
WFWidget::$class
WFWidget::$errors
WFWidget::$formatter
WFWidget::$hasRestoredState
WFWidget::$hidden
WFWidget::$name
WFWidget::$value
WFWidget::$widgetLabel

Inherited from WFView

WFView::$children
WFView::$cssImports
WFView::$enabled
WFView::$id
WFView::$importInHead
WFView::$jsActions
WFView::$jsEvents
WFView::$jsImports
WFView::$originalOnEvent
WFView::$page
WFView::$parent
Methods
static method exposedProperties (line 117)
  • access: public
static void exposedProperties ()

Redefinition of:
WFWidget::exposedProperties()
Constructor __construct (line 102)

Constructor.

WFImage __construct ( $id,  $page)
  • $id
  • $page

Redefinition of:
WFWidget::__construct()
Constructor.
canPushValueBinding (line 299)
void canPushValueBinding ()

Redefinition of:
WFWidget::canPushValueBinding()
Does this widget use the "value" binding to WRITE data back to the bindings?
render (line 247)
void render ([ $blockContent = NULL])
  • $blockContent

Redefinition of:
WFView::render()
Render the view into HTML.
setBaseDir (line 164)

The base path for the image path. This is a good place to put http://domain.com/path/to/img/ if you're linking to an external image.

void setBaseDir (string $path)
  • string $path: The base path to the image path stored in value.
setupExposedBindings (line 137)
void setupExposedBindings ()

Redefinition of:
WFWidget::setupExposedBindings()
Set up all exposed bindings for this widget.

Inherited Methods

Inherited From WFWidget

WFWidget::__construct()
WFWidget::addError()
WFWidget::addErrors()
WFWidget::bind()
WFWidget::bindingByName()
WFWidget::bindings()
WFWidget::canPushValueBinding()
WFWidget::errors()
WFWidget::exposedBindings()
WFWidget::exposedProperties()
WFWidget::formattedValue()
WFWidget::formatter()
WFWidget::hasRestoredState()
WFWidget::hidden()
WFWidget::name()
WFWidget::processBindingOptions()
WFWidget::propagateValueToBinding()
WFWidget::pullBindings()
WFWidget::pushBindings()
WFWidget::restoreState()
WFWidget::setFormatter()
WFWidget::setHidden()
WFWidget::setName()
WFWidget::setupExposedBindings()
WFWidget::setValue()
WFWidget::setWidgetLabel()
WFWidget::unbind()
WFWidget::value()
WFWidget::valueForBinding()
WFWidget::widgetLabel()

Inherited From WFView

WFView::__construct()
WFView::addChild()
WFView::allConfigFinishedLoading()
WFView::children()
WFView::cloneWithID()
WFView::enabled()
WFView::exposedProperties()
WFView::getForm()
WFView::getJSActions()
WFView::getListenerJS()
WFView::getListenerJSInScriptTag()
WFView::getOnEvent()
WFView::getWidgetDir()
WFView::getWidgetWWWDir()
WFView::id()
WFView::importCSS()
WFView::importJS()
WFView::jsEndHTML()
WFView::jsStartHTML()
WFView::page()
WFView::parent()
WFView::removeChild()
WFView::render()
WFView::setEnabled()
WFView::setId()
WFView::setJSonBlur()
WFView::setJSonClick()
WFView::setListener()
WFView::setOnEvent()
WFView::setParent()
WFView::yuiPath()

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()

Documentation generated on Thu, 14 May 2009 16:20:06 -0400 by phpDocumentor 1.4.2