PHP Classes

File: site/demos/treeview.php

Recommend this page to a friend!
  Packages of Boss Ibrahim Mussa   Caelrik   site/demos/treeview.php   Download  
File: site/demos/treeview.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Caelrik
Build Web user interface from PHP components
Author: By
Last change:
Date: 8 days ago
Size: 874 bytes
 

 

Contents

Class file image Download
<?php

use Caelrik\Ui\Components\TreeView;

// A checkable tree: its checkboxes post the checked ids with the form around it.
return TreeView::make('shared-folders')
    ->label('Folders to share')
    ->checkable('folders')
    ->nodes([
        ['id' => 1, 'label' => 'Documents', 'expanded' => true, 'children' => [
            ['id' => 2, 'label' => 'Invoices', 'checked' => true],
            ['id' => 3, 'label' => 'Contracts', 'children' => [
                ['id' => 4, 'label' => 'Signed'],
                ['id' => 5, 'label' => 'Drafts'],
            ]],
            ['id' => 6, 'label' => 'Reports'],
        ]],
        ['id' => 7, 'label' => 'Pictures', 'children' => [
            ['id' => 8, 'label' => 'Holidays'],
            ['id' => 9, 'label' => 'Family'],
        ]],
        ['id' => 10, 'label' => 'Archive (read only)', 'disabled' => true],
    ]);