Classes

Class Form

Form abstraction used to create forms not tied to ORM backed models,
or to other permanent datastores. Ideal for implementing forms on top of
API services, or contact forms.

Building a form

This class is most useful when subclassed. In a subclass you
should define the _buildSchema, _buildValidator and optionally,
the _execute methods. These allow you to declare your form's
fields, validation and primary action respectively.

You can also define the validation and schema by chaining method
calls off of $form->schema() and $form->validator().

Deprecated

Returns

First validates the form, then calls the _execute() hook method.
This hook method can be implemented in subclasses to perform
the action of the form. This may be sending email, interacting
with a remote API, or anything else you may need.

Parameters

array
$data

Form data.

Returns

boolean

False on validation failure, otherwise returns the
result of the _execute() method.

Parameters

Returns

Throws

Returns the validation rules tagged with $name. It is possible to have
multiple different named validation sets, this is useful when you need
to use varying rules when saving from different routines in your system.

If a validator has not been set earlier, this method will build a valiator
using a method inside your class.

For example, if you wish to create a validation set called 'forSubscription',
you will need to create a method in your Table subclass as follows: