Download the PHP package digivia/form-handler without Composer

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

Symfony form handler bundle V2

If you want to separate the logic carried out during the submission of a form from the processing of the request carried out in the controller, this bundle is for you :)

Thus, the controller only does its job: to receive a request and send back a response.

Requirements :

Need to use php8 and Symfony 5.4 / 6

Installation

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

Configuration

:new:

Thanks to Symfony autoconfigure, no need to configure tags or nothing else

Usage

Create your form, it must implement Digivia\FormHandler\Contract\Form\FormWithHandlerInterface

Then, you can provide your handler class name in static method getHandlerClassName

Create your form handler :

In your controller, call the form handler factory :

As you can see, this Controller just get request and send a response...

You can give to your form some options and to your handler "process" method extra parameters :

Note :

The two callables, $onSuccess and $render, must return a Response (Symfony\Component\HttpFoundation\Response). The form handler will provide status code HTTP 303 if response is an instance of Symfony\Component\HttpFoundation\RedirectResponse.

If form is submitted, but not valid, the handler will provide an HTTP 422 code to the response.

So you can use this bundle with Turbo like this - see : https://github.com/symfony/ux/blob/0a6ebad4bc67f74ba3bbb52f6586085ddcd28ab1/src/Turbo/README.md#forms

Events

when the form is submitted, several events are dispatched:

Event dispatched just before the call to the process method. It allows you to modify the data received from the form. Thanks to this event, you can therefore act on the data sent to the process method of your Handler.

Event dispatched after a successful submission of the form, and after the processing carried out by the "process" method.

Event dispatched after a failed submission of the form.


Do not hesitate to contact me if you have any questions or ideas for development. Enjoy!

Eric BATARSON - Digivia


All versions of form-handler with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
symfony/dependency-injection Version ^5.4 || ^6.0
symfony/http-kernel Version ^5.4 || ^6.0
symfony/form Version ^5.4 || ^6.0
symfony/http-foundation Version ^5.4 || ^6.0
symfony/config Version ^5.4 || ^6.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 digivia/form-handler contains the following files

Loading the files please wait ....