Download the PHP package burgov/key-value-form-bundle without Composer

On this page you can find all versions of the php package burgov/key-value-form-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 key-value-form-bundle

KeyValueFormBundle

A form type for managing key-value pairs.

Installation

Then add the bundle to your application:

Usage

To add to your form, use the KeyValueType type:

The type extends the collection type, so for rendering it in the browser, the same logic is used. See the Symfony docs on collection types for an example on how to render it client side.

The type adds four options to the collection type options, of which one is required:

Besides that, this type overrides some defaults of the collection type and it's recommended you don't change them: type is set to BurgovKeyValueRow::class and allow_add and allow_delete are always true.

Working with SonataAdminBundle

In order to render your form with add/remove buttons, you need to extend the template SonataAdminBundle:Form:form_admin_fields.html.twig and add this little piece of code

The KeyValueCollection

To work with collections and the Symfony2 form layer, you can provide an adder and a remover method. This however only works if the adder method expects one argument only. This bundle provides composed key-value pairs.

Your model class typically will provide a method like:

This will lead to the add method not being found by the form layer. To work around this problem, the bundle provides the KeyValueCollection object. To use it, you need to set the use_container_object option on the form type to true. A form definition could look like this:

Your model class then needs to provide a setOptions method that accepts a Burgov\Bundle\KeyValueFormBundle\KeyValueContainer argument. A flexible implementation might look like this:


All versions of key-value-form-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
symfony/form Version ^2.3|^3.0|^4.0|^5.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 burgov/key-value-form-bundle contains the following files

Loading the files please wait ....