Download the PHP package depa/middleware-formularhandler without Composer

On this page you can find all versions of the php package depa/middleware-formularhandler. 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 middleware-formularhandler

Middleware-FormHandler

StyleCI

This library allows you to handle your forms, check for missing fields and only uses fields that you realy expect to be submitted.

Installation

Run the following to install this library:

Info

If your form has fields that are not defined inside the config, the handler will not use them due to security reasons.

Documentation

At the bottom of the Doc, i'll show you a quick example on how the config is build like.

The Implementation

To Implement the Middleware, just add a Route to your routes files that passes it's request into the middleware:

after that, be sure to provide a config-file inside your config/autoload folder, that contains anything the Middleware needs to check your forms. We recommend you to use our config-file and just adjust it to fit your needs

The needed Data

The Formhandler needs JSON-Requests to run properly and also it responds with JSON, describing whats going on.

The Adapters

Currently there are 2 working Adapters:

The Local-Adapters

The Adapter field must be directly inside the form-definition:

The Global-Adapters

A Global Adapter is defined in the very top of the config:

if you defined a global adapter and want to use it, go ahead and put the name of it (in this case: globalTestAdapter-1) inside of the adapter-field of your form-config:

The EMail-Template

The Template, you specified in the Config can be dynamic through twig:

the variables you use must be valid fields of your form and also defined in your config.

The EMail-Subject

Like the EMail-Template, also the EMail-Subject do support the twig-renderer.

The Reply-To Header

The E-Mail Adapter's can handle with the "Reply-To" email-header you can define it inside the Adapter config like this:

reply-to only works if:

The Required-Attribute

The Formhandler can check if a field is required in your form and dont accept the request if it is missing. if you don't define required or required as false, the handler might not get data of the field because it was missing in the request. If you want to set a field as required add this into the config of the field:

The Example

Credits

This bundle has been developed by designpark.

License

The MIT License (MIT). Please see License File for more information.


All versions of middleware-formularhandler with dependencies

PHP Build Version
Package Version
Requires psr/http-server-middleware Version ^1.0
psr/container Version ^1.0
zendframework/zend-servicemanager Version ^3.4
swiftmailer/swiftmailer Version ^6.2
true/punycode Version ^2.1
zendframework/zend-problem-details Version ^1.0
zendframework/zend-json Version ^3.1
zendframework/zend-diactoros Version ^2.1
twig/twig Version ^2.11
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 depa/middleware-formularhandler contains the following files

Loading the files please wait ....