Documentation

Option extends Child
in package

Form select option element class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.6.0

Table of Contents

$attributes  : array<string|int, mixed>
Child element attributes
$cData  : bool
Child element node value CDATA flag
$childNodes  : array<string|int, mixed>
Object child nodes
$childrenFirst  : bool
Flag to render children before node value or not
$indent  : string
Indentation for formatting purposes
$nodeName  : string
Child element node name
$nodeValue  : string
Child element node value
$output  : string
Child output
$parent  : AbstractNode
Parent node
$preserveWhiteSpace  : bool
Flag to preserve whitespace
__construct()  : mixed
Constructor
__toString()  : string
Render Dom child object to string
addChild()  : mixed
Add a child to the object
addChildren()  : mixed
Add children to the object
addNodeValue()  : Child
Add to the child node value
create()  : Child
Static factory method to create a child object
deselect()  : Option
Deselect the option value
getAttribute()  : string
Get the attribute of the child object
getAttributes()  : array<string|int, mixed>
Get the attributes of the child object
getChild()  : Child
Get the child nodes of the object
getChildNodes()  : array<string|int, mixed>
Get the child nodes of the object (alias)
getChildren()  : array<string|int, mixed>
Get the child nodes of the object
getIndent()  : string
Return the indent
getNodeContent()  : string
Return the child node content, including tags, etc
getNodeName()  : string
Return the child node name
getNodeValue()  : string
Return the child node value
getParent()  : AbstractNode
Return the parent node
getTextContent()  : string
Return the child node content, including tags, etc
getValue()  : string
Get the option value
hasAttribute()  : bool
Determine if the child object has an attribute
hasChildNodes()  : bool
Get whether or not the child object has children (alias)
hasChildren()  : bool
Get whether or not the child object has children
isCData()  : bool
Determine if the child node value is CDATA
isChildrenFirst()  : bool
Determine if child nodes render first, before the node value
isSelected()  : bool
Determine if the option value is selected
parseFile()  : Child
Static method to parse an XML/HTML string from a file
parseString()  : Child|array<string|int, mixed>
Static method to parse an XML/HTML string
preserveWhiteSpace()  : Child
Set whether to preserve whitespace
removeAttribute()  : Child
Remove an attribute from the child element object
removeChild()  : void
Remove all child nodes from the object
removeChildren()  : void
Remove all child nodes from the object
render()  : mixed
Render the child and its child nodes.
select()  : Option
Select the option value
setAsCData()  : Child
Set the child node value as CDATA
setAttribute()  : Child
Set an attribute for the child element object
setAttributes()  : Child
Set an attribute or attributes for the child element object
setChildrenFirst()  : Child
Set whether child nodes render first, before the node value
setIndent()  : mixed
Set the indent
setNodeName()  : Child
Set the child node name
setNodeValue()  : Child
Set the child node value
setParent()  : AbstractNode
Set the parent node
setValue()  : Option
Set the option value

Properties

$attributes

Child element attributes

protected array<string|int, mixed> $attributes = []

$cData

Child element node value CDATA flag

protected bool $cData = false

$childNodes

Object child nodes

protected array<string|int, mixed> $childNodes = []

$childrenFirst

Flag to render children before node value or not

protected bool $childrenFirst = false

$indent

Indentation for formatting purposes

protected string $indent = null

$nodeName

Child element node name

protected string $nodeName = null

$nodeValue

Child element node value

protected string $nodeValue = null

$preserveWhiteSpace

Flag to preserve whitespace

protected bool $preserveWhiteSpace = true

Methods

__construct()

Constructor

public __construct(string $value, string $nodeValue[, array<string|int, mixed> $options = [] ]) : mixed

Instantiate the option element object

Parameters
$value : string
$nodeValue : string
$options : array<string|int, mixed> = []
Return values
mixed

__toString()

Render Dom child object to string

public __toString() : string
Return values
string

addChild()

Add a child to the object

public addChild(mixed $c) : mixed
Parameters
$c : mixed
Tags
throws
InvalidArgumentException
Return values
mixed

addChildren()

Add children to the object

public addChildren( $children) : mixed
Parameters
$children :
Tags
throws
Exception
Return values
mixed

addNodeValue()

Add to the child node value

public addNodeValue(string $value) : Child
Parameters
$value : string
Return values
Child

create()

Static factory method to create a child object

public static create(string $name[, string $value = null ][, array<string|int, mixed> $options = [] ]) : Child
Parameters
$name : string
$value : string = null
$options : array<string|int, mixed> = []
Return values
Child

getAttribute()

Get the attribute of the child object

public getAttribute(string $name) : string
Parameters
$name : string
Return values
string

getAttributes()

Get the attributes of the child object

public getAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getChild()

Get the child nodes of the object

public getChild(int $i) : Child
Parameters
$i : int
Return values
Child

getChildNodes()

Get the child nodes of the object (alias)

public getChildNodes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getChildren()

Get the child nodes of the object

public getChildren() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIndent()

Return the indent

public getIndent() : string
Return values
string

getNodeContent()

Return the child node content, including tags, etc

public getNodeContent([bool $ignoreWhiteSpace = false ]) : string
Parameters
$ignoreWhiteSpace : bool = false
Return values
string

getNodeName()

Return the child node name

public getNodeName() : string
Return values
string

getNodeValue()

Return the child node value

public getNodeValue() : string
Return values
string

getTextContent()

Return the child node content, including tags, etc

public getTextContent([bool $ignoreWhiteSpace = false ]) : string
Parameters
$ignoreWhiteSpace : bool = false
Return values
string

getValue()

Get the option value

public getValue() : string
Return values
string

hasAttribute()

Determine if the child object has an attribute

public hasAttribute(string $name) : bool
Parameters
$name : string
Return values
bool

hasChildNodes()

Get whether or not the child object has children (alias)

public hasChildNodes() : bool
Return values
bool

hasChildren()

Get whether or not the child object has children

public hasChildren() : bool
Return values
bool

isCData()

Determine if the child node value is CDATA

public isCData() : bool
Return values
bool

isChildrenFirst()

Determine if child nodes render first, before the node value

public isChildrenFirst() : bool
Return values
bool

isSelected()

Determine if the option value is selected

public isSelected() : bool
Return values
bool

parseFile()

Static method to parse an XML/HTML string from a file

public static parseFile(string $file) : Child
Parameters
$file : string
Tags
throws
Exception
Return values
Child

parseString()

Static method to parse an XML/HTML string

public static parseString(string $string) : Child|array<string|int, mixed>
Parameters
$string : string
Return values
Child|array<string|int, mixed>

preserveWhiteSpace()

Set whether to preserve whitespace

public preserveWhiteSpace([bool $preserve = true ]) : Child
Parameters
$preserve : bool = true
Return values
Child

removeAttribute()

Remove an attribute from the child element object

public removeAttribute(string $a) : Child
Parameters
$a : string
Return values
Child

removeChild()

Remove all child nodes from the object

public removeChild(int $i) : void
Parameters
$i : int
Return values
void

removeChildren()

Remove all child nodes from the object

public removeChildren() : void
Return values
void

render()

Render the child and its child nodes.

public render(int $depth[, string $indent = null ][, bool $inner = false ]) : mixed
Parameters
$depth : int
$indent : string = null
$inner : bool = false
Return values
mixed

setAsCData()

Set the child node value as CDATA

public setAsCData([bool $cData = true ]) : Child
Parameters
$cData : bool = true
Return values
Child

setAttribute()

Set an attribute for the child element object

public setAttribute(string $a, string $v) : Child
Parameters
$a : string
$v : string
Return values
Child

setAttributes()

Set an attribute or attributes for the child element object

public setAttributes(array<string|int, mixed> $a) : Child
Parameters
$a : array<string|int, mixed>
Return values
Child

setChildrenFirst()

Set whether child nodes render first, before the node value

public setChildrenFirst([bool $first = true ]) : Child
Parameters
$first : bool = true
Return values
Child

setIndent()

Set the indent

public setIndent(string $indent) : mixed
Parameters
$indent : string
Return values
mixed

setNodeName()

Set the child node name

public setNodeName(string $name) : Child
Parameters
$name : string
Return values
Child

setNodeValue()

Set the child node value

public setNodeValue(string $value) : Child
Parameters
$value : string
Return values
Child

setValue()

Set the option value

public setValue(mixed $value) : Option
Parameters
$value : mixed
Return values
Option

Search results