agence-adeliom / easy-fields-bundle
A Symfony bundle for EasyAdmin that provide some fields
Installs: 1 223
Dependents: 5
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 2
Language:JavaScript
Type:symfony-bundle
Requires
- php: ^7.4|^8.0
- ext-json: *
- easycorp/easyadmin-bundle: ^3.4 || ^v4.0.0
- embed/embed: ^4.2
- nyholm/psr7: ^1.4
- stof/doctrine-extensions-bundle: ^1.5
- symfony/config: ^4.4 || ^5.2
- symfony/dependency-injection: ^4.4 || ^5.2
- symfony/deprecation-contracts: ^2.2 || ^v3.0.0
- symfony/event-dispatcher: ^4.4 || ^5.2
- symfony/form: ^4.4 || ^5.2
- symfony/framework-bundle: ^4.4 || ^5.2
- symfony/http-kernel: ^4.4 || ^5.2
- symfony/options-resolver: ^4.4 || ^5.2
- symfony/property-access: ^4.4 || ^5.2
- symfony/psr-http-message-bridge: ^2.0
This package is auto-updated.
Last update: 2022-07-21 04:13:09 UTC
README
Easy Fields Bundle
Provide some fields for Easyadmin.
Installation
Install with composer
composer require agence-adeliom/easy-fields-bundle
Documentation
AssociationField
Is an extension of EasyAdmin's AssociationField that allow you to create new object et select one from the curent page.
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\AssociationField; // You have to add this form theme @EasyFields/form/association_widget.html.twig ... yield AssociationField::new('property', "label");
EnumField
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\EnumField; ... yield EnumField::new('property', "label") ->setEnum(YourEnumClass::class);
FormTypeField
This field is a custom integration that allow you to bind any raw form type to your admin.
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\FormTypeField; ... yield FormTypeField::new('property', "label", YourFormTypeClass::class)
TranslationField
An A2lix TranslationFormBundle integration for EasyAdmin.
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\TranslationField; // You have to add this form theme @EasyFields/form/translations_widget.html.twig ... yield TranslationField::new('property', "label", [ 'description' => [ 'field_type' => 'textarea', 'label' => 'descript.', 'locale_options' => [ 'es' => ['label' => 'descripción'] 'fr' => ['display' => false] ] ] ])
ChoiceMaskField
An fork of Sonata's ChoiceMaskField for EasyAdmin.
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\ChoiceMaskField; // You have to add this form theme @EasyFields/form/choice_mask_widget.html.twig ... yield ChoiceMaskField::new('property', "label") ->setChoices([ 'uri' => 'uri', 'route' => 'route', ]) // Associative array. Describes the fields that are displayed for each choice. ->setMap([ 'route' => ['route', 'parameters'], 'uri' => ['uri'], ]);
SortableCollectionField
Is an extension of EasyAdmin's CollectionField that allow you to sort entries.
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\SortableCollectionField; // You have to add this form theme @EasyFields/form/sortable_widget.html.twig ... // NOTE : property can be a *ToMany or an array. yield SortableCollectionField::new('property', "label") ->setEntryType(YourEntryFromType::class) ->allowAdd() // Allow to add new entry ->allowDelete() // Allow to remove entries ->allowDrag() // Allow to drag entries ;
IconField
Is an icon picker.
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\IconField; // You have to add this form theme @EasyFields/form/icon_widget.html.twig ... yield IconField::new('property', "label") ->setJsonUrl($url) // Must be a public json file with an array of your icon's classes ->setFonts($fonts) // Must be an array of yours fonticon css file ->setSelectButtonLabel() // Change label ->setCancelButtonLabel() // Change label ->setShowAllButtonLabel() // Change label ->setSearchPlaceholder() // Change label ->setNotResultMessage() // Change label ;
PositionSortableField
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\PositionSortableField; // You have to add this form theme @EasyFields/form/form-easy-field-position-sortable.html.twig ... yield PositionSortableField::new('property', "label");
OembedField
Usage
use Adeliom\EasyFieldsBundle\Admin\Field\OembedField; // You have to add this form theme @EasyFields/form/oembed_widget.html.twig ... yield OembedField::new('property', "label");
Twig render
# Get HTML code {{ property|oembed_html }} # Get Dimensions {{ property|oembed_size }}