Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • Attributes
  • Img
  • Overview
  • Namespace
  • Class
  • Tree

Class Attributes

Attributes - Base class for HTML attributes

ArrayObject implements IteratorAggregate, Traversable, ArrayAccess, Serializable, Countable
Extended by Xoops\Html\Attributes implements Xoops\Core\AttributeInterface

Direct known subclasses

Xoops\Form\Element, Xoops\Html\Img

Indirect known subclasses

AwesomeButton, FormDhtmlTextArea, Xoops\Form\DateTime, Xoops\Form\DhtmlTextArea, Xoops\Form\Editor, Xoops\Form\ElementTray, Xoops\Form\File, Xoops\Form\GroupCheckbox, Xoops\Form\GroupFormCheckbox, Xoops\Form\Hidden, Xoops\Form\Label, Xoops\Form\Mail, FormTextArea, Xoops\Form\OptionElement, Xoops\Form\Password, Xoops\Form\Radio, Xoops\Form\RadioYesNo, Xoops\Form\Raw, Xoops\Form\Select, Xoops\Form\SelectCountry, Xoops\Form\SelectEditor, Xoops\Form\SelectGroup, Xoops\Form\SelectLanguage, PublisherFormDateTime, Xoops\Form\SelectLocale, Xoops\Form\SelectMatchOption, Xoops\Form\SelectTheme, Xoops\Form\SelectTimeZone, Xoops\Form\SelectUser, Xoops\Form\Tab, Xoops\Form\TabTray, Xoops\Form\Text, Xoops\Form\TextArea, Xoops\Form\Token, Xoops\Form\Button, Xoops\Form\Url, XoopsEditor, XoopsFormButton, XoopsFormButtonTray, XoopsFormCaptcha, XoopsFormCheckBox, XoopsFormColorPicker, XoopsFormDateTime, XoopsFormDhtmlTextArea, XoopsFormEditor, Xoops\Form\ButtonTray, XoopsFormElement, XoopsFormElementTray, XoopsFormFile, XoopsFormHidden, XoopsFormHiddenToken, XoopsFormLabel, XoopsFormPassword, XoopsFormRadio, XoopsFormRadioYN, XoopsFormSelect, Xoops\Form\Captcha, XoopsFormSelectCheckGroup, XoopsFormSelectCountry, XoopsFormSelectEditor, XoopsFormSelectGroup, XoopsFormSelectLang, XoopsFormSelectMatchOption, XoopsFormSelectTheme, XoopsFormSelectTimezone, XoopsFormSelectUser, XoopsFormText, Xoops\Form\Checkbox, XoopsFormTextArea, XoopsFormTextDateSelect, XoopsFormTinymce, XoopsFormTinymce4, Xoops\Form\ColorPicker, Xoops\Form\DateSelect
Namespace: Xoops\Html
Package: Xoops\Html
Category: Xoops\Html\Attributes
Copyright: 2014 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Link: http://xoops.org
Located at oops_lib/Xoops/Html/Attributes.php
Methods summary
public
# __construct( array $attributes = array() )

__construct

__construct

Parameters

$attributes
array of attribute name => value pairs

Overrides

ArrayObject::__construct()
public
# add( string $name, string|string[] $value )

add an element attribute value to a multi-value attribute (like class)

add an element attribute value to a multi-value attribute (like class)

Parameters

$name
name of the attribute
$value
value for the attribute
protected
# suppressRender( string|string[] $names )

Add attributes to the render suppression list

Add attributes to the render suppression list

Parameters

$names
attributes to suppress
protected boolean
# doRender( string $name )

controls rendering of specific attributes

controls rendering of specific attributes

Example, some form elements have "attributes" that are not standard html attributes to be included in the rendered tag, like caption, or the value for a textarea element.

Also, any attribute starting with a ":" is considered to be a control item, and is not rendered.

Parameters

$name
attribute name to check

Returns

boolean
true if this attribute should be rendered, false otherwise
public string
# renderAttributeString( )

render attributes as a string to include in HTML output

render attributes as a string to include in HTML output

Returns

string
public mixed
# get( string $name, mixed $default = false )

Retrieve an attribute value.

Retrieve an attribute value.

Parameters

$name
Name of an attribute
$default
A default value returned if the requested attribute is not set.

Returns

mixed
The value of the attribute, or $default if not set.

Implementation of

Xoops\Core\AttributeInterface::get()
public
# set( string $name, mixed $value = null )

Set an attribute value.

Set an attribute value.

Parameters

$name
Name of the attribute option
$value
Value of the attribute option

Implementation of

Xoops\Core\AttributeInterface::set()
public boolean
# has( string $name )

Determine if an attribute exists.

Determine if an attribute exists.

Parameters

$name
An attribute name.

Returns

boolean
TRUE if the given attribute exists, otherwise FALSE.

Implementation of

Xoops\Core\AttributeInterface::has()
public mixed
# remove( string $name )

Remove an attribute.

Remove an attribute.

Parameters

$name
An attribute name.

Returns

mixed

An attribute value, if the named attribute existed and has been removed, otherwise NULL.

Implementation of

Xoops\Core\AttributeInterface::remove()
public array
# clear( )

Remove all attributes.

Remove all attributes.

Returns

array
old values

Implementation of

Xoops\Core\AttributeInterface::clear()
public array
# getAll( )

Get a copy of all attributes

Get a copy of all attributes

Returns

array
An array of attributes
public array
# getNames( )

Get a list of all attribute names

Get a list of all attribute names

Returns

array
An array of attribute names/keys
public array
# setAll( mixed $values )

Replace all attribute with new set

Replace all attribute with new set

Parameters

$values
array (or object) of new attributes

Returns

array
old values
public
# setMerge( array $values )

Set multiple attributes by using an associative array

Set multiple attributes by using an associative array

Parameters

$values
array of new attributes
public
# setArrayItem( string $stem, string $name, mixed $value )

Set an element attribute array

Set an element attribute array

This allows an attribute which is an array to be built one element at a time.

Parameters

$stem
An attribute array name.
$name

An attribute array item name. If empty, the value will be appended to the end of the array rather than added with the key $name.

$value
An attribute array item value.
public array
# getAllLike( string|null $nameLike = null )

Retrieve a set of attributes based on a partial name

Retrieve a set of attributes based on a partial name

Parameters

$nameLike

restrict output to only attributes with a name starting with this string.

Returns

array
an array of all attributes with names matching $nameLike
Methods inherited from ArrayObject
append(), asort(), count(), exchangeArray(), getArrayCopy(), getFlags(), getIterator(), getIteratorClass(), ksort(), natcasesort(), natsort(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), serialize(), setFlags(), setIteratorClass(), uasort(), uksort(), unserialize()
Constants inherited from ArrayObject
ARRAY_AS_PROPS, STD_PROP_LIST
Properties summary
protected string[] $suppressRenderAttributes

list of attributes to NOT render

list of attributes to NOT render

# []
API documentation generated by ApiGen