yceruto/rich-form-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Form features for Symfony applications

Installs: 2 214

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 0

Open Issues: 5

Type:symfony-bundle

2.0.0 2020-07-30 12:57 UTC

README

RichForm provides autocomplete form types with optimal performance for your Symfony applications.

Build Status

Requirements

Backend:

  • PHP 7.1.3 or higher;
  • Symfony 3.4 applications or higher;

Frontend:

Installation

$ composer require yceruto/rich-form-bundle
$ php bin/console assets:install --symlink

Configuration

Controller

# config/routes/rich_form.yaml
rich_form:
    resource: '@RichFormBundle/Resources/config/routing/entity2.xml'

Form Themes

# config/packages/twig.yaml
twig:
    form_themes:
        - '@RichForm/form/fields.html.twig'

Assets

This bundle doesn't provide any version of the Select2 plugin.

<!doctype html>
<html>
    <head>
        <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />

        <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.full.min.js"></script>
        <script src="{{ asset('bundles/richform/entity2.js') }}"></script>
    </head>

Basic Usage

$formBuilder->add('category', Entity2Type::class, [
    'class' => Category::class,
]);

The Entity2Type extends from the built-in EntityType by adding the most awesome Select2 features: search via Ajax, pagination and custom result templates. All of them combined with the EntityType options like query_builder and new options like search_by, order_by, max_results and more.

License

This software is published under the MIT License