PHP code example of phpro / zf-annotated-forms

1. Go to this page and download the library: Download phpro/zf-annotated-forms library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpro / zf-annotated-forms example snippets


return array(
    'modules' => array(
        'Phpro\\AnnotatedForms',
        // other libs...
    ),
    // Other config
);

return array(
    'annotated_forms' => array(
        'form-key' => array(
            'initializers' => array(),
            'listeners' => array(),
            'cache' => null,
            'cache_key' => 'cached-form-key',
            'entity' => '',
        ),
    ),
);

$serviceManager->get('form-key');

'caches' => [
    'Cache\AnnotatedForms' => [
        'adapter' => [
            'name' => 'redis',
            'options' =>  [
                'namespace' => 'zf-annotated-forms',
                'server' => [
                    'host' => '127.0.0.1',
                    'port' => '6379',
                ],
                'ttl' => 86400 // 1 day
            ],
        ],
        'plugins' => [
            'exception_handler' => [
                'throw_exceptions' => false,
            ],
            'serializer',
        ],
    ],
],