2017 © Pedro Peláez
 

symfony-bundle entity-hidden-type-bundle

Hidden field for Symfony2 entities

image

glifery/entity-hidden-type-bundle

Hidden field for Symfony2 entities

  • Wednesday, July 19, 2017
  • by Glifery
  • Repository
  • 2 Watchers
  • 14 Stars
  • 30,738 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 12 Versions
  • 11 % Grown

The README.md

EntityHidden form type

Hidden entity type for Symfony2/Symfony3 forms., (*1)

What is it?

This is a Symfony2/Symfony3 form type that allows you to add an entity in your form that would be displayed as a hidden input., (*2)

Installation

Step 1: Download EntityHiddenTypeBundle using composer

$ php composer.phar require glifery/entity-hidden-type-bundle

Composer will install the bundle to your project's vendor/glifery directory., (*3)

Step 2: Enable the bundle

Enable the bundle in the kernel:, (*4)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Glifery\EntityHiddenTypeBundle\GliferyEntityHiddenTypeBundle(),
        // ...
    );
}

Usage

Simple usage:

You can use the EntityHiddenType::class type in your forms just like this:, (*5)

<?php
    // ...
    $builder->add('entity', EntityHiddenType::class, array(
        'class' => 'YourBundle:Entity' // That's all !
    ));

You can also use the DocumentHiddenType::class type:, (*6)

<?php
    // ...
    $builder->add('document', DocumentHiddenType::class, array(
        'class' => 'YourBundle:Document' // That's all !
    ));

There is only one required option "class". You must specify entity class in Symfony format that you want to be used in your form., (*7)

Advanced usage:

You can use the EntityHiddenType::class or DocumentHiddenType::class type in your forms this way:, (*8)

<?php
    // ...
    $builder->add('entity', EntityHiddenType::class, array(
        'class' => 'YourBundle:Entity'
        'property' => 'entity_id', // Mapped property name (default is 'id')
        'data' => $entity, // Field value by default
        'multiple' => true, // You can pass collection of 'YourBundle:Entity' instead of single entity
        'invalid_message' => 'The entity does not exist.', // Message that would be shown if no entity found
        'em' => 'common_em' // You can use specified entity manager for use with entity_hidden
        'dm' => 'common_dm' // You can use specified document manager for use with document_hidden
    ));

Reporting an issue or a feature request

Feel free to report any issues. If you have an idea to make it better go ahead and modify and submit pull requests., (*9)

The Versions

19/07 2017

dev-master

9999999-dev

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

19/07 2017

2.1.0

2.1.0.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

24/12 2016

dev-symfony-3-support

dev-symfony-3-support

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

24/12 2016

2.0.0

2.0.0.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

11/02 2016

1.2.1

1.2.1.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

10/02 2016

1.2.0

1.2.0.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

13/06 2015

1.1.1

1.1.1.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

13/06 2015

1.1.0

1.1.0.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

27/05 2015

1.0.3

1.0.3.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

15/02 2015

1.0.2

1.0.2.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

15/02 2015

1.0.1

1.0.1.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony

12/02 2015

1.0.0

1.0.0.0

Hidden field for Symfony2 entities

  Sources   Download

MIT

The Requires

 

by Avatar Glifery

entity hidden form type symfony