Skip to content

Commit df27dda

Browse files
committed
readme
1 parent f1c015e commit df27dda

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,46 @@ Usage
2828
Once the extension is installed, simply use it in your code by :
2929

3030
```php
31+
32+
<?php
33+
// Example of data. $items structure https://github.com/jonmiles/bootstrap-treeview#data-structure
34+
$items = [
35+
[
36+
'text' => 'Node 1'
37+
'icon' => "glyphicon glyphicon-stop",
38+
'selectedIcon' => "glyphicon glyphicon-stop",
39+
'href' => "#node-1",
40+
'selectable' => true,
41+
'state' => [
42+
'checked' => true,
43+
'disabled' => true,
44+
'expanded' => true,
45+
'selected' => true
46+
],
47+
'tags' => ['available'],
48+
...,
49+
'nodes'=>
50+
[
51+
...
52+
]
53+
],
54+
[
55+
'text' => 'Folder 2',
56+
'nodes' => [
57+
['text' => 'Node 2.1'],
58+
['text' => 'Node 2.2']
59+
]
60+
]
61+
];
62+
?>
63+
3164
<?= \lesha724\bootstraptree\TreeView::widget([
3265
'htmlOptions'=>[
3366
'id'=>'treeview-tabs'
3467
],
3568
'options'=>[
3669
//https://github.com/jonmiles/bootstrap-treeview#options
37-
'data'=>$items, // $items structure https://github.com/jonmiles/bootstrap-treeview#data-structure
70+
'data'=>$items,
3871
'enableLinks'=>true,
3972
'showTags'=>true,
4073
'levels'=>3

0 commit comments

Comments
 (0)