Elao/ElaoFormBundle

Name: ElaoFormBundle

Owner: Elao

Description: Tools & enhancements for Symfony 2 forms

Created: 2013-11-05 15:49:39.0

Updated: 2017-06-16 02:24:22.0

Pushed: 2016-05-30 13:23:04.0

Homepage:

Size: 112

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ElaoFormBundle

Best served with Elao/form.js!

Tools & enhancements for Symfony 2 forms

Installation:

Add ElaoFormBundle to your composer.json:

mposer require "elao/form-bundle":"~2.1"

Enable the bundle in the kernel:

p
pp/AppKernel.php

ic function registerBundles()

$bundles = array(
    // ...
    new Elao\Bundle\FormBundle\ElaoFormBundle(),
);

Usage:

Use the provided form template, globally:

ig Configuration
:
form_themes:
    - "ElaoFormBundle:Form:form_elao_layout.html.twig"

Or on a specific form:

orm_theme form 'ElaoFormBundle:Form:form_elao_layout.html.twig' %}
Features:
Collections:

Provide support for collection:

$('[data-collection]').collection();

Note: For more details, see Elao/form.js collection documentation.

Help:

Provide an help option that automatically adds an help block to the field. Use as below:

$builder->add('email', EmailType::class, array('help' => "A valid email address"));

Note: The help string is gonna be translated by default just like the label of the field.

Buttons:

Provide sortcut for adding submit and reset buttons: All form have now an optional option “submit” and “reset”, setting it to true adds a default submit/reset button

$form = $this->createForm(PostType::class, $post, array('submit' => true, 'reset' => true));

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.