Download the PHP package phpro/zf-annotated-forms without Composer
On this page you can find all versions of the php package phpro/zf-annotated-forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package zf-annotated-forms
Repository abandoned 2020-11-27
This repository has been archived since we are not using it anymore internally. Feel free to use it AS-IS, we won't be providing any support anymore.
Installation
Add to composer.json
Add to application config
Configuration files
Copy module.zf-annotated-forms-global.dist.php
to your application configuration autoload directory.
You can adjust this file and set the default values. The annotated_forms
can also be declared in your module config.
Form configuration
initializers
:
Array of service manager keys, which return InitializerInterfaces. These initializers are used to inject dependencies in form elements.
listeners
:
Array of service manager keys, which return EventListenerAggregateInterface. These listeners can be used to adjust the form.
cache
:
Service manager key, which return Cache\StorageInterface. This cache storage is used to save parsed annotations.
This can be left null
if you do not want to be using cache.
cache_key
:
The cache key where the parsed configuration is being saved in the cache locator.
This can be left null
if you do not want to be using cache.
entity
:
The name of the class which contains the form annotations.
Load the form
You can now use the serviceManager to retrieve your form. In the config example above, you can use:
Configure cache
While configuring a cache storage, there are some things to keep in mind:
- Disable the exceptions by default
- Add a serializer
- The ttl of the forms can be infinite if you clear the cache after building your application
Sample configuration:
All versions of zf-annotated-forms with dependencies
zendframework/zend-cache Version 2.*
zendframework/zend-code Version 2.*
zendframework/zend-eventmanager Version 2.*
zendframework/zend-form Version 2.*
zendframework/zend-modulemanager Version 2.*
zendframework/zend-servicemanager Version 2.*
zendframework/zend-stdlib Version 2.*