Download the PHP package thomasleconte/form-generator without Composer

On this page you can find all versions of the php package thomasleconte/form-generator. 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

Form generator

composer require thomasleconte/form-generator

This is a library that make you able to generate a form. This library use reflection principle to generate the best result from a class name or an existing object.
This form generator is compatible with Doctrine ORM. In fact, if one of your property doesn't have a PHP type, but a Doctrine type annotation, it will take this one. Moreover, in the case of a select list generation, you can fill the list with Doctrine by specifying class name, key attribute and attribute value.

Check this out !

Summary

Construction
Basic generation
Personalize inputs
Personalize form
Surround your inputs / form
Special inputs
Hydrate dynamically select field

Construction

By default, constructor doesn't need arguments. But you can provide a current Doctrine EntityManager instance.

If you installed Doctrine but you did not provide EntityManager instance to generator, it will try to get it from bootstrap.php file at root of your project. This file is generally provided by most of Doctrine tutorials online, and return an instance of Doctrine EntityManager.
For more informations, check this tutorial.

Basic generation

Or with a current object :

You can add attribute to a field after generated a form. Update is also available :

Personalize your inputs

By default, all inputs just have an auto-generated name attribute. But you can give them all attributes that you want. Imagine you want to add a class to firstname input of our User class used before :

You can also decide to hide one of fields. By default, "id" field of your entity is hidden and you can't override it. You can hide others one with "hide" field option : ``

Personalize your form

Like inputs personalization, you can add all attributes that you want, just like that :

Surround your inputs / form

You can surround generation result of each inputs or form for give them div parent for example. When you use it, you must provide {{content}} which corresponding to input of form generation result. Check this out :

Special inputs

Sometimes you will want to use select or textarea tags inside your form. For use it, just precize type of input. For example, you want a textarea for firstname attribute and select list for age attribute of our User class. Check this out :

Select field

When you make a select field, you must provide a list of items, with a value key for differentiate each of them, and a name key to display. Check this example :

Moreover, you can fill items array with Doctrine. Instead of array, just give class name, and specify optionLabel / optionValue with attributes name of your class specified before. This is how to do :


All versions of form-generator with dependencies

PHP Build Version
Package Version
No informations.
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 thomasleconte/form-generator contains the following files

Loading the files please wait ...