Download the PHP package codete/form-generator-bundle without Composer

On this page you can find all versions of the php package codete/form-generator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package form-generator-bundle

FormGeneratorBundle

Build Status SensioLabsInsight

We were extremely bored with writing/generating/keeping-up-to-date our FormType classes so we wanted to automate the process and limit required changes only to Entity/Document/Whatever class and get new form out of the box - this is how FormGenerator was invented.

You're looking at the documentation for version 2.0

Basic Usages

Consider a class

Now instead of writing whole PersonFormType and populating FormBuilder there we can use instead:

Voila! Form for editing all annotated properties is generated for us. We could even omit type=".." in annotations if Symfony will be able to guess the field's type for us.

Specifying Field Options

By default everything you specify in @Form\Field (except for type) annotation will be passed as an option to generated form type. To illustrate:

is equivalent to:

This approach has few advantages like saving you a bunch of keystrokes each time you are specifying options, but there are downsides too. First, if you have any custom option for one of your modifiers you forget to unset, Symfony will be unhappy and will let you know by throwing an exception. Another downside is that we have reserved type property and it's needed as an option for the repeated type. If you ever find yourself in one of described cases, or you just prefer to be explicit, you can put all Symfony fields' options into an options property:

When Form Generator creates a form field and finds options property, it will pass them as that field's options to the FormBuilder. Effectively this allows you to separate field's options from options for your configuration modifiers which can be a gain on its own.

Adding fields not mapped to a property

Sometimes you may need to add a field that will not be mapped to a property. An example of such use case is adding buttons to the form:

All fields added on the class level come last in the generated form, unless a form view (described below) specifies otherwise. Contrary to other class-level settings, @Fields will not be inherited by child classes.

Form Views

In the example we have defined additional form views in @Form\Form annotation so we can add another argument to createFormBuilder

And we will get Form with properties specified in annotation. We can also add/override fields and their properties like this:

But if you need something more sophisticated than Annotations we have prepared few possibilities that can be either added manually or by tagging your services. For each of them FormGenerator allows you to pass any additional informations you want in optional $context argument. Both ways allows you to specify priority which defines order of execution (default is 0, if two or more services have same priority then first added is executed first).

If you have enabled Service autoconfiguration the bundle will automatically tag services for you.

FormViewProvider

These are used to provide fields list and/or basic configuration for Forms and are doing exactly same thing as @Form\Form annotation.

Tag for service: form_generator.view_provider

FormConfigurationModifier

These can modify any form configuration provided by class itself or FormViewProviders. Feel free to remove or add more stuff to your Form or tweak existing configuration

Tag for service: form_generator.configuration_modifier

FormFieldResolver

These are responsible for creating actual field in Form and can be used for instance to attach Transformers to your fields.

Tag for service: form_generator.field_resolver

Embedded Forms

If you need embedded forms we got you covered:

Such sub-form will contain all annotated properties from given model. To specify a view for the generated embedded form just specify it in the configuration:


All versions of form-generator-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
doctrine/annotations Version ~1.2
symfony/form Version ~3.4|~4.0
symfony/framework-bundle Version ~3.4|~4.0
doctrine/instantiator Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codete/form-generator-bundle contains the following files

Loading the files please wait ....