Download the PHP package perry-rylance/dom-form without Composer

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

DOMForm

A DOMDocument based form library, useful for quickly populating HTML forms, server side user input validation using HTML5's form validation elements, serialization, and error handling.

The intended use case is for when you have some page that renders a form, either for a new resource or populated with data from an existing resource. When you want to process submissions, you can submit the form with the incoming data (eg $_POST). This will handle validation. Once you are happy with the resulting data, you can serialize that from the form safe in the knowledge that it's been validated client and server side.

Designed for use with PerryRylance\DOMDocument.

Earlier versions of PerryRylance\DOMDocument had features for populating forms and getting data back, these were dropped in 2.* as that libraries sole focus became jQuery-like PHP DOM manipulation and processing forms was deemed out of scope. This library gives you back this functionality with more standardised behaviour when compared to how the browser's client side validation works.

Requirements

Installation

I recommend installing this package via Composer.

composer require perry-rylance/dom-form

Usage

Here's a very, very basic example, assuming you have a file named form.html and have required your autoloader.

Basic example

Error handling

Error handlers subclass PerryRylance\DOMForm\Exceptions\Handlers\Handler and effect how population errors are handled.

You can pass a Handler to DOMForm's constructor. If you don't supply one, then the default is ThrowException which will throw an exception when validation fails during form population.

DisplayHtml is also provided for your convenience, which will add a HTML error message to the relevant field(s) on which validation has failed. You can use this to re-present to form in it's invalid state to the end user so they can correct their input.

Testing

Docker is required to run tests.

Tests can be run using tests.sh.

You can run specific tests from your native CLI like so:

docker-compose run php82 php /app/vendor/bin/phpunit tests --filter=testCannotAlterDisabledInput

Documentation

The requirements to generate documentation are as follows:

To generate documentation, use the following command.

php <path/to/your/phpDocumentor.phar> -t ./docs --ignore vendor/

Support

Please feel free to open issues here or submit pull requests.


All versions of dom-form with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2.0
ext-dom Version *
perry-rylance/dom-document Version ^3.0.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 perry-rylance/dom-form contains the following files

Loading the files please wait ....