2017 © Pedro Peláez
 

symfony-bundle fastentitybundle

Fast entity bundle for Symfony 2, used to generate dropdowns from entities faster than the default 'entity' formtype

image

dotcommerce/fastentitybundle

Fast entity bundle for Symfony 2, used to generate dropdowns from entities faster than the default 'entity' formtype

  • Wednesday, February 13, 2013
  • by TheDevilOnLine
  • Repository
  • 0 Watchers
  • 0 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

DotCommerce's FastEntityBundle

Fast entity bundle for Symfony 2, used to generate dropdowns from entities faster than the default 'entity' formtype. To do this a new form type has to be generated for the entity used in the dropdown, (*1)

Usage

You need to use the command line tool from Symfony (app/console) to generate the new form types. The syntax is simple:, (*2)

$ app/console dotcommerce:generate:fastentity BundleName[:EntityName] [FieldName]
  • BundleName is the name of you Bundle (i.e. MyBundle)
  • EntityName (optional) is the name of your entity (i.e. MyEntity), if not defined it will generate form types for all the entities in the bundle
  • FieldName (optional) the name of the field which is displayed in the dropdown, if not defined it will try to use the field 'name'

So if I want to generate a fast form type, for my entity Customer which is in my StoreBundle and I want to display the lastname of the customer in the dropdown, I need to use command:, (*3)

$ app/console dotcommerce:generate:fastentity StoreBundle:Customer lastname

To use the newly generated form type you have to specify it manualy in a Form. The name for your new formtype is the entityname in lowercase prepended by the word 'fast', i.e. for the above generated Customer entity, the formtype is called 'fastcustomer'., (*4)

Last updates

2012-12-07 - First public version, (*5)

Installation

Pretty simple with composer, add:, (*6)

{
    require: {
        "dotcommerce/fastentitybundle": "dev-master"
    }
}

If you use a deps file, add:, (*7)

[DotCommerceFastEntityBundle]
    git://github.com/TheDevilOnLine/Symfony-FastEntityBundle.git

Or if you want to clone the repos:, (*8)

git clone git://github.com/TheDevilOnLine/Symfony-FastEntityBundle.git vendor/dotcommerce/fastentitybundle/DotCommerce/FastEntityBundle

Add the namespaces to your autoloader unless you are using composer

``` php <?php // File: app/autoload.php $loader->registerNamespaces(array( 'DotCommerce\FastEntityBundle' => DIR.'/../vendor/dotcommerce/fastentitybundle/DotCommerce/FastEntityBundle', // ... ));, (*9)


### Add DotCommerceFastEntityBundle to your application kernel ``` php <?php // File: app/AppKernel.php public function registerBundles() { return array( // ... new DotCommerce\FastEntityBundle\DotCommerceFastEntityBundle(), // ... ); }

The Versions

13/02 2013

dev-master

9999999-dev https://github.com/TheDevilOnLine/Symfony-FastEntityBundle

Fast entity bundle for Symfony 2, used to generate dropdowns from entities faster than the default 'entity' formtype

  Sources   Download

MIT

The Requires

 

symfony2 entity fast thedevilonline drowndown