mrself / symfony-tree-form-type
Symfony package for tree form type
Installs: 51
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Language:TypeScript
Type:project
Requires
- php: ^7.2.0
- symfony/form: >=4.3.11
- symfony/framework-bundle: >=4.3.11
- symfony/yaml: ^5.2
Requires (Dev)
README
Still under development!
Installing
composer require mrself/symfony-tree-form-type:^1.2.3
Make sure config/packages/twig.yaml
has the following code:
twig: form_themes: - '@TreeType/tree_type.html.twig'
Assets
The main js asset is located here assets/dist/main.js
. It should be required in your front-end bundle or just added
to your html.
Usage
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 ]); }