Download the PHP package oromedialab/zf2-lazy-form without Composer

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

Fall in love with Zend Form. Again!

Developed and Maintained by Ibrahim Azhar Armar

Gitter

Introduction

Zf2LazyForm module is developed to eliminate duplication and enforce reuse for elements, validators, filters, attributes, options etc. We enhanced the module to support numerous features on top of existing features of zend-form

Installation

Install using composer

Install using GIT clone

Enable Zf2 Module

Enable the module by adding Oml\Zf2LazyForm in your config/application.config.php file.

Important Instruction

Form must be initialized using FormElementManager, lets see an example

Example

Short Syntax

Let's consider the below example to define form element using short syntax

When an element is defined using addFormElement() by default empty input filters are injected, you don't have to worry about defining input filters separately. To be precise you never define input filters in form again, instead you define it in the config file and reuse it across forms and elements, we'll see an example of this below

You can also use short names offered by ZF2, instead of writing Zend\Form\Element\Text for defining form elements, you can just type text, same goes for rest of elements

Configurable Validators, Filters, Attrbutes & Options

Define validators, filters, attributes and options in config file to reuse it across forms and elements. the syntax is same as what you use in zend-form

Lazy Set

Once configuration is defined, it can be reused using lazy-set

To use lazy-set(s) in your form element, you need to define it in each element using an array, refer the example below where we apply lazy-set = [1] to an element

In some cases you may want to disable filters, you can do it by using filters => false, refer the below example where we apply lazy-set = 2 which has an element with filters => false

Placeholders

In many instances you may want to define different validation values for a given validator. Lets consider StringLength where it makes sense to have a default minimum and maximum length for all form elements, however for specific element we may want to overwrite it with specific values, this is where Placeholders comes to our rescue, lets see some example

The defined placeholder :min and :max in above configuration can be replaced on 3 level

Replace placeholder value on a global level

Replace placeholder value on a form level

Replace placeholder value per element

Zend\ServiceManager\ServiceManager

You can access ServiceManager object in your Form::init() by using $this->getServiceLocator(). Because form is intiailized using FormElementManager, by default an instance of ServiceManager is injected in the form

Global Form Elements and Attributes

Most often we use common elements in forms such as, all forms must have a submit button, a csrf token must be included, it must contain specific class names, or bind hydator etc. this can be done easily using closure in your config file

An instance of Zend\Form is injected by default when you define $config['oml']['zf2-lazy-form'][*] with closure, this allows you to modify or add elements to the form on a global level, you can also use addFormElement() or other available module functions here

Options

Available Options in Config File :

Available Options in Form Class Extending Oml\Zf2LazyForm\Form\Base :

Feel free to use native zend-form functions parallelly with this module if the function offered by this module does not suffice your need. it is designed to avoid conflict with existing Zend\Form functionality, hence allowing you to use add() or addFormElement() together in your form


All versions of zf2-lazy-form with dependencies

PHP Build Version
Package Version
Requires php Version >5.4
zendframework/zend-form Version ~2.5
zendframework/zend-servicemanager 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 oromedialab/zf2-lazy-form contains the following files

Loading the files please wait ....