Simple HTML decorator for tags

package Default
inherited_from \Zend\Tag\Cloud\Decorator\AbstractTag

 Methods

Create a new decorator with options

__construct(array|\Traversable $options = null
Inherited

Allow passing options to the constructor.

inherited_from \Zend\Tag\Cloud\Decorator\DecoratorInterface::__construct()

Parameters

$options

array\Traversable

Get class list

getClassList() : array

Returns

array

Get encoding

getEncoding() : string
Inherited

Returns

string

Retrieve Escaper instance

getEscaper() : \Zend\Escaper\Escaper
Inherited

If none registered, instantiates and registers one using current encoding.

Returns

\Zend\Escaper\Escaper

Retrieve font size unit

getFontSizeUnit() : string

Returns

string

Get HTML tags map

getHTMLTags() : array

Returns

array

Retrieve maximum font size

getMaxFontSize() : integer

Returns

integer

Retrieve minimum font size

getMinFontSize() : integer

Returns

integer

Defined by Tag

render(\Zend\Tag\ItemList $tags) : array

Parameters

$tags

\Zend\Tag\ItemList

Exceptions

\Zend\Tag\Cloud\Decorator\Exception\InvalidArgumentException

Returns

array

Set a list of classes to use instead of fontsizes

setClassList(array $classList = null) : \Zend\Tag\Cloud\Decorator\HTMLTag

Parameters

$classList

array

Exceptions

\Zend\Tag\Cloud\Decorator\Exception\InvalidArgumentException When the classlist is empty
\Zend\Tag\Cloud\Decorator\Exception\InvalidArgumentException When the classlist contains an invalid classname

Returns

\Zend\Tag\Cloud\Decorator\HTMLTag

Set encoding

setEncoding($value) : \Zend\Tag\Cloud\Decorator\HTMLCloud
Inherited

Parameters

$value

Returns

\Zend\Tag\Cloud\Decorator\HTMLCloud

Set Escaper instance

setEscaper(\Zend\Escaper\Escaper $escaper) : \Zend\Tag\Cloud\Decorator\HtmlCloud
Inherited

Parameters

$escaper

\Zend\Escaper\Escaper

Returns

\Zend\Tag\Cloud\Decorator\HtmlCloud

Set the font size unit

setFontSizeUnit(string $fontSizeUnit) : \Zend\Tag\Cloud\Decorator\HTMLTag

Possible values are: em, ex, px, in, cm, mm, pt, pc and %

Parameters

$fontSizeUnit

string

Exceptions

\Zend\Tag\Cloud\Decorator\Exception\InvalidArgumentException When an invalid fontsize unit is specified

Returns

\Zend\Tag\Cloud\Decorator\HTMLTag

Set the HTML tags surrounding the <a> element

setHTMLTags(array $htmlTags) : \Zend\Tag\Cloud\Decorator\HTMLTag

Parameters

$htmlTags

array

Returns

\Zend\Tag\Cloud\Decorator\HTMLTag

Set maximum font size

setMaxFontSize(integer $maxFontSize) : \Zend\Tag\Cloud\Decorator\HTMLTag

Parameters

$maxFontSize

integer

Exceptions

\Zend\Tag\Cloud\Decorator\Exception\InvalidArgumentException When fontsize is not numeric

Returns

\Zend\Tag\Cloud\Decorator\HTMLTag

Set minimum font size

setMinFontSize(integer $minFontSize) : \Zend\Tag\Cloud\Decorator\HTMLTag

Parameters

$minFontSize

integer

Exceptions

\Zend\Tag\Cloud\Decorator\Exception\InvalidArgumentException When fontsize is not numeric

Returns

\Zend\Tag\Cloud\Decorator\HTMLTag

Set options from array

setOptions(array $options) : \Zend\Tag\Cloud\Decorator\AbstractTag
Inherited

Parameters

$options

array

Configuration for the decorator

Returns

\Zend\Tag\Cloud\Decorator\AbstractTag

Validate an HTML attribute name

validateAttributeName(string $name) 
Inherited

Parameters

$name

string

Exceptions

\Zend\Tag\Exception\InvalidAttributeNameException

Validate an HTML element name

validateElementName(string $name) 
Inherited

Parameters

$name

string

Exceptions

\Zend\Tag\Exception\InvalidElementNameException

Wrap html with tag

wrapTag(string $html) : string
Inherited

Parameters

$html

string

Returns

string

 Properties

 

Allowed fontsize units

$allowedFontSizeUnits : array

Default

array('em', 'ex', 'px', 'in', 'cm', 'mm', 'pt', 'pc', '%')
 

List of tags which get assigned to the inner element instead of font-sizes.

$classList : array

Default

null
 

Encoding to use

$encoding : string

Default

'UTF-8'
 

$escaper

$escaper : \Zend\Escaper\Escaper

Default

 

Unit for the fontsize

$fontSizeUnit : string

Default

'px'
 

List of HTML tags

$htmlTags : array

Default

array('li')
 

Maximum fontsize

$maxFontSize : integer

Default

20
 

Minimum fontsize

$minFontSize : integer

Default

10
 

Option keys to skip when calling setOptions()

$skipOptions : array

Default

array('options', 'config')