PHP code example of mrself / symfony-tree-form-type
1. Go to this page and download the library: Download mrself/symfony-tree-form-type 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/ */
mrself / symfony-tree-form-type example snippets
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options)
{
$builder->add('alternatives', MrTreeType::class, [
'class' => DataClass::class,
'tree' => [
[
'id' => '1',
'text' => 'Item 1',
'parent' => '#'
]
],
'multiple' => true
]);
}