HTML Helper
This helper adds functionality not available in the CodeIgniter HTML Helper.
Functions
tree_builder($items, $html)
Helps build the HTML for a UI Tree element.
Note: This function only created the HTML for the UI Tree element. You will still need to include the script on your own. This may or may not be done for you in the admin theme.
Name | Default | Required | Description |
---|---|---|---|
items | Yes | An array of items that may or may not have children (under a key named children for each appropriate array entry). See example format below. | |
html | Yes | The HTML string to parse. See example below. |
Example
This is taken from the Pages module which has the UI Tree for sorting pages.
// example format of $items array
Array
(
[0] => Array
(
[id] => 1
[parent_id] => 0
[title] => Home
)
[1] => Array
(
[id] => 2
[parent_id] => 0
[title] => Page missing
)
[2] => Array
(
[id] => 2
[parent_id] => 0
[title] => Contact Us
)
[3] => Array
(
[id] => 3
[parent_id] => 0
[title] => Search
[children] => Array
(
[0] => Array
(
[id] => 4
[parent_id] => 3
[title] => Results
)
[1] => Array
(
[id] => 5
[parent_id] => 3
[title] => No Results
)
)
)
)
// example format of $html string
{{ title }}{{ children }}