Class TOCItem A representation of a single entry in a table of contents or breadcrumb. One entry contains all children.
- Author
- Thomas Hackl hackl.nosp@m.@dat.nosp@m.a-que.nosp@m.st.d.nosp@m.e GPL2 or any later version
- Since
- Stud.IP 5.0
◆ __construct()
◆ __toString()
String representation of this item.
- Returns
- string
◆ addChild()
addChild |
( |
TOCItem |
$newChild, |
|
|
|
$position = null |
|
) |
| |
Add a new child to this item, optionally at a given position.
- Parameters
-
TOCItem | $newChild | |
null | int | $position | |
- Returns
- $this
◆ countAllChildren()
Count the elements in the hierarchy, starting at (and counting in) current item.
- Returns
- int
◆ flatten()
Generates a flat representation of the current item and all its children and children's children.
- Returns
- array|TOCItem[]
◆ getActiveItem()
◆ getChildren()
Gets this item's children as array.
- Returns
- array
◆ getIcon()
Get this item's icon.
- Returns
- Icon
◆ getLinkAttributes()
Gets the additional link attributes.
- Returns
- array
◆ getParent()
Gets this item's parent element.
- Returns
- null|TOCItem
◆ getPath()
getPath |
( |
|
$separator = '/' | ) |
|
Get a string representation of the current hierarchy as breadcrumb-like path.
- Parameters
-
string | $separator | which separator tu use between elements? |
- Returns
- string
◆ getRoot()
Get the root element of the current hierarchy (= the element with no parent)
- Returns
- bool
◆ getTitle()
Get the display title.
- Returns
- string
◆ getUrl()
Get this item's URL, with additional parameters if set.
- Returns
- string
◆ hasChildren()
Does the current item have children?
- Returns
- bool
◆ isActive()
Check if current item is active.
- Returns
- bool
◆ isRoot()
Is the current element the root of its hierarchy?
- Returns
- bool
◆ removeChild()
Removes the given child.
- Parameters
-
- Returns
- $this
◆ setActive()
Set active status of current item.
- Parameters
-
- Returns
- $this
◆ setChildren()
setChildren |
( |
array |
$newChildren | ) |
|
Sets a new array of child elements.
- Parameters
-
- Returns
- $this
◆ setIcon()
Set a new icon.
- Parameters
-
- Returns
- $this
◆ setLinkAttributes()
setLinkAttributes |
( |
|
$attributes | ) |
|
Sets new additional link attributes.
- Parameters
-
- Returns
- $this
◆ setParent()
Sets a new parent element for this item.
- Parameters
-
- Returns
- $this
◆ setTitle()
setTitle |
( |
string |
$newTitle | ) |
|
Set a new display title.
- Parameters
-
- Returns
- $this
◆ setUrl()
setUrl |
( |
string |
$newUrl, |
|
|
mixed |
$parameters = null |
|
) |
| |
Set a new URL, optionally with additional link parameters.
- Parameters
-
string | $newUrl | |
mixed | null | $parameters | |
- Returns
- $this
◆ $active
◆ $children
◆ $icon
◆ $link_attributes
◆ $parent
◆ $title
◆ $url
The documentation for this class was generated from the following file: