Overview

Namespaces

  • Nethgui
    • Adapter
    • Authorization
    • Component
    • Controller
      • Collection
      • Table
    • Exception
    • Log
    • Model
    • Module
      • Help
      • Notification
    • Renderer
    • Serializer
    • System
    • Test
      • Tool
      • Unit
        • Nethgui
          • Adapter
            • ParameterSet
          • Authorization
          • Log
          • Module
            • Notification
          • Renderer
          • Serializer
          • System
          • Utility
          • View
        • Test
          • Tool
    • Utility
    • View
    • Widget
      • Xhtml
  • None
  • Test
    • Tool

Classes

  • AbstractWidget
  • XhtmlWidget
  • Overview
  • Namespace
  • Class
  • Deprecated

Class XhtmlWidget

An abstract widget that renders an XHTML string

Nethgui\Widget\AbstractWidget implements Nethgui\Renderer\WidgetInterface, Nethgui\Log\LogConsumerInterface
Extended by Nethgui\Widget\XhtmlWidget implements Nethgui\View\CommandReceiverInterface

Direct known subclasses

Nethgui\Widget\Xhtml\Button, Nethgui\Widget\Xhtml\CheckBox, Nethgui\Widget\Xhtml\Selector, Nethgui\Widget\Xhtml\Slider, Nethgui\Widget\Xhtml\Tabs, Nethgui\Widget\Xhtml\TextArea, Nethgui\Widget\Xhtml\TextInput, Nethgui\Widget\Xhtml\TextLabel, Nethgui\Widget\Xhtml\TextList, Nethgui\Widget\Xhtml\CollectionEditor, Nethgui\Widget\Xhtml\ElementList, Nethgui\Widget\Xhtml\FieldsetSwitch, Nethgui\Widget\Xhtml\Hidden, Nethgui\Widget\Xhtml\ObjectPicker, Nethgui\Widget\Xhtml\ObjectsCollection, Nethgui\Widget\Xhtml\Panel, Nethgui\Widget\Xhtml\RadioButton

Indirect known subclasses

Nethgui\Widget\Xhtml\Columns, Nethgui\Widget\Xhtml\Fieldset, Nethgui\Widget\Xhtml\FileUpload, Nethgui\Widget\Xhtml\Form, Nethgui\Widget\Xhtml\ProgressBar
Abstract
Namespace: Nethgui\Widget
Api
Located at Widget/XhtmlWidget.php
Methods summary
protected Nethgui\Renderer\Xhtml
# getRenderer( )

Get the object that renders the widget's view.

Get the object that renders the widget's view.

Returns

Nethgui\Renderer\Xhtml

Api

protected string
# labeledControlTag( string $label, string $tag, string $name, integer $flags, string $cssClass = '', array $attributes = array(), string $tagContent = '' )

Generate XHTML markup fragment for a FORM control with a LABEL tag

Generate XHTML markup fragment for a FORM control with a LABEL tag

Parameters

$label
The label text
$tag
The XHTML tag of the control.
$name
The name of the view parameter that holds the data
$flags
Flags bitmask {STATE_CHECKED, STATE_DISABLED, LABEL_*}
$cssClass
The class attribute value
$attributes
Generic attributes array See Nethgui\Widget\XhtmlWidget::openTag()
$tagContent
The content of the tag. An empty string results in a self-closing tag.

Returns

string

See

Nethgui\Widget\XhtmlWidget::controlTag()

Api

protected string
# controlTag( string $tag, string|array $name, integer $flags, string $cssClass = '', array $attributes = array(), $tagContent = '' )

Generate XHTML markup for a FORM control, such as INPUT, BUTTON, TEXTAREA

Generate XHTML markup for a FORM control, such as INPUT, BUTTON, TEXTAREA

Parameters

$tag
The XHTML tag of the control.
$name
The name of the view parameter that holds the data
$flags
Flags bitmask {STATE_CHECKED, STATE_DISABLED}
$cssClass
The class attribute value
$attributes
Generic attributes array See Nethgui\Widget\XhtmlWidget::openTag()
$tagContent

Returns

string

Api

protected type
# applyDefaultLabelAlignment( integer $flags, integer $default )

If no LABEL_* bit is set, apply $default bit

If no LABEL_* bit is set, apply $default bit

Parameters

$flags
The input bits
$default
The default LABEL bit

Returns

type
The output bits
protected string
# openTag( string $tag, array $attributes = array(), string $content,… )

Get an XHTML opening tag string

Get an XHTML opening tag string

Parameters

$tag
The tag name (DIV, P, FORM...)
$attributes
The HTML attributes (id, name, for...)
$content,…
Raw content string

Returns

string

Api

protected string
# selfClosingTag( string $tag, array $attributes )

Get an XHTML self-closing tag string

Get an XHTML self-closing tag string

Parameters

$tag
$attributes

Returns

string

See

Nethgui\Widget\XhtmlWidget::openTag()

Api

protected string
# closeTag( string $tag )

Get an XHTML closing tag string

Get an XHTML closing tag string

Parameters

$tag
Tag to be closed.

Returns

string

Api

protected string
# getControlName( string $parts = '' )

Generate a control name for the given $parts. If no parts are given the name is generated from the module referenced by the view.

Generate a control name for the given $parts. If no parts are given the name is generated from the module referenced by the view.

Parameters

$parts

Returns

string

Api

protected array
# getJsWidgetTypes( )

Get the js types required by this widget class.

Get the js types required by this widget class.

Each element of the returned array is a string :

Returns

array
An array of required js widget types

Api

public string
# render( )

Transform the current object in a string value.

Transform the current object in a string value.

Returns

string

Api

Overrides

Nethgui\Widget\AbstractWidget::render()
public mixed
# executeCommand( Nethgui\View\ViewInterface $origin, string $selector, string $name, array $arguments )

Specify an implementation for the given method and arguments.

Specify an implementation for the given method and arguments.

The original view that generated the command and the selector string that identifies the logical target provide more contextual informations.

Parameters

$origin
$selector
$name
$arguments

Returns

mixed

Implementation of

Nethgui\View\CommandReceiverInterface::executeCommand()
protected closure
# getTranslateClosure( string $message, array $args = array() )

Get a closure that provides a default value for an attribute

Get a closure that provides a default value for an attribute

Parameters

$message
$args

Returns

closure
protected
# escapeUnobstrusive( $content )
protected
# canEscapeUnobstrusive( $flags )
public Nethgui\Widget\AbstractWidget
# insertPlugins( string $name = 'Plugin' )

Insert any (sub)view object found in the view $name collection into the widget.

Insert any (sub)view object found in the view $name collection into the widget.

Parameters

$name
Optional - Default "Plugin"

Returns

Nethgui\Widget\AbstractWidget
the widget itself.

See

Nethgui\Widget\AbstractWidget::insert()

Api

protected string
# optGroups( string $value, array $choices )

Return a string of OPTGROUP and OPTION tags.

Return a string of OPTGROUP and OPTION tags.

Parameters

$value
The "selected" value
$choices
options and groups of options

Returns

string

See

redmine #348
public static
# hashToDatasource( $H, $sort = FALSE )
protected array
# getChoices( string $name, string & $dataSourceName )

Construct the choices

Construct the choices

Parameters

$name
Name of the view member where the currently selected value is stored
$dataSourceName
$dataSourceName Output parameter, where the effective datasource name is stored

Returns

array
The datasource choices.

Api

Methods inherited from Nethgui\Widget\AbstractWidget
__construct(), __toString(), getAttribute(), getChildren(), getClientEventTarget(), getInstanceCounter(), getLog(), hasAttribute(), hasChildren(), insert(), prepend(), renderChildren(), renderContent(), setAttribute(), setLog(), wrapChild()
Properties inherited from Nethgui\Widget\AbstractWidget
$view
Nethgui Framework API documentation generated by ApiGen