PHP code example of aleslanger / checkboxtree

1. Go to this page and download the library: Download aleslanger/checkboxtree library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aleslanger / checkboxtree example snippets


\aleslanger\Forms\CheckBoxTree\Bridges\ExtensionMethodRegistrator::register();


$form = new \Nette\Forms\Form;  
  
/*             
 - First
      |___ - Third
 - Second                  
 */
 
 $items = array( 1 => array('id' => 1, 'title' => 'First',  'parent_id' => ''),
                 2 => array('id' => 2, 'title' => 'Second', 'parent_id' => ''),
                 3 => array('id' => 3, 'title' => 'Third',  'parent_id' => 1),);
  
              
$form->addCheckboxTree("list", "Label", $items);