Download the PHP package ray/web-form-module without Composer
On this page you can find all versions of the php package ray/web-form-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ray/web-form-module
More information about ray/web-form-module
Files in ray/web-form-module
Package web-form-module
Short Description Web Form module for Ray.Di
License MIT
Informations about the package web-form-module
Ray.WebFormModule
An aspect oriented web form module powered by Aura.Input and Ray.Di.
Getting Started
Installation
Composer install
$ composer require web-form-module
Module install
Usage
Form class
We provide two methods on self-initializing form class, one is init()
method where we add an input field on form and apply fileters and rules. The other method method is submit()
where it submit data. See more detail at Aura.Input self-initializing forms.
Controller
We annotate the methods which web form validation is required with @FormValidation
. We can specify form object property name with name
and failiure method name with @onFailure
.
View
You can render entire form html when __toString
is given.
or render input element basis.
CSRF Protections
You can provide your custom AntiCsrf
class. See more detail at Aura.Input
Validation Exception
When we install Ray\WebFormModule\FormVndErrorModule
as following,
A Ray\WebFormModule\Exception\ValidationException
will be thrown.
We can echo catched exception to get application/vnd.error+json media type.
More detail for vnd.error+json
can be add with @VndError
annotation.
This optional module is handy for API application.
Demo
$ php -S docs/demo/1.csrf/web.php
All versions of web-form-module with dependencies
ray/di Version ^2.7
aura/input Version ^1.2
aura/filter Version ^2.3|3.x-dev
aura/html Version ^2.5
ray/aura-session-module Version ^1.1