Download the PHP package stroker/form without Composer

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

StrokerForm

Build Status Coverage Status Scrutinizer Code Quality SensioLabsInsight Total Downloads HHVM Status

ZF2 module for extending forms with live clientside validation without need to write js validation code. You only need to define your validation rules server side with ZF2 and this module automaticaly adds the same rules with jQueryValidate. In case a client side version of the validation rule doesn't exist a fallback is done using ajax. For basic usage examples see the sandbox project StrokerFormSandbox.

BC Breaks since 1.0.0

BC Breaks since 0.1.0

For the new version you need to copy config/strokerform.global.php.dist to your projects config/autoload dir.

Installation

Installation of StrokerForm uses composer. For composer documentation, please refer to getcomposer.org.

  1. cd my/project/directory
  2. create or modify the composer.json file within your ZF2 application file with following contents:

  3. install composer via curl -s https://getcomposer.org/installer | php (on windows, download https://getcomposer.org/installer and execute it with PHP). Then run php composer.phar install
  4. open my/project/directory/configs/application.config.php and add the following key to your modules:

  5. copy the file config/strokerform.global.php.dist from vendor\stroker\zf2-form to your projects config/autoload directory and rename it to strokerform.global.php.
  6. copy the assets to your public folder (my/project/directory/public).

Usage

First we need to make sure jquery is loaded by our application and the headScript() and inlineScript() view helpers are called. If you already have this in place you can skip this step.

For the ajax validation to work inputfilters needs to be hooked to the form. We need to create a serviceFactory and register it with a unique alias to the formManager (this is an pluginManager). If the inputFilters are already set to the form (i.e. in your form constructor) it's enough to register the form as an invokable

Now let's add our new factory to the formManager.

Last thing we need to do is invoking the StrokerFormPrepare view helper where you are rendering your form. This view helper add all the needed javascripts to the headScript view helper

Renderers

A renderer should implement the RendererInterface and is responsible for modifying the form rendering (setting inline javascript, modifying the form element attributes, view helpers etc.). Currently only the jqueryValidate renderer is available. Support for other validation libraries can be implemented as a seperate renderer.

JqueryValidate

Options

Styling

If you are using twitter bootstrap and the recommended form structure the styling works out of the box. When you are using the ZF2 view helpers for your form you could style the input fields error and valid classes which are added on the fly by the jquery plugin.

Excluding elements from clientside validation

You can set the option strokerform-exclude on a form element


All versions of form with dependencies

PHP Build Version
Package Version
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 stroker/form contains the following files

Loading the files please wait ....