2017 © Pedro PelĂĄez
 

symfony-bundle hidden-entity-type-bundle

Hidden field for Symfony entities

image

shapecode/hidden-entity-type-bundle

Hidden field for Symfony entities

  • Monday, July 16, 2018
  • by Nicklog
  • Repository
  • 1 Watchers
  • 4 Stars
  • 12,919 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 14 Versions
  • 28 % Grown

The README.md

Shapecode - Hidden Entity Type Bundle

Hidden entity type for Symfony forms., (*1)

paypal, (*2)

PHP Version Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads Daily Downloads License, (*3)

What is it?

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

Installation

Step 1: Download HiddenEntityTypeBundle using composer

$ composer require shapecode/hidden-entity-type-bundle

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

Step 2: Enable the bundle

Enable the bundle in the config if flex it didÂŽnt do it for you:, (*6)

<?php
// config/bundles.php

return [
    // ...
    Shapecode\Bundle\HiddenEntityTypeBundle\ShapecodeHiddenEntityTypeBundle::class => ['all' => true],
    // ...
];

Usage

Simple usage:

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

<?php

use Shapecode\Bundle\HiddenEntityTypeBundle\Form\Type\HiddenEntityType;

// ...
$builder->add('entity', HiddenEntityType::class, array(
    'class' => YourBundleEntity::class
));

You can also use the HiddenDocumentType::class type:, (*8)

<?php

use Shapecode\Bundle\HiddenEntityTypeBundle\Form\Type\HiddenDocumentType;

// ...
$builder->add('document', HiddenDocumentType::class, array(
    'class' => YourBundleDocument::class
));

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

Advanced usage:

You can use the HiddenEntityType or HiddenDocumentType type in your forms this way:, (*10)

<?php
// ...
$builder->add('entity', HiddenEntityType::class, array(
    'class' => YourBundleEntity::class, // required
    'property' => 'entity_id', // Mapped property name (default is 'id'), not required
    'multiple' => false, // support for an array of entities, not required
    'data' => $entity, // Field value by default, not required
    'invalid_message' => 'The entity does not exist.', // Message that would be shown if no entity found, not required
));

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., (*11)

Original

The orginal source is from Glifery (https://github.com/Glifery/EntityHiddenTypeBundle) but seems not to be supported anymore., (*12)

The Versions

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