reliv / zf-input-filter-service
Uses ZendFrameworks InputFilter config to build filters and validators from services from a general service container
Installs: 1 039
Dependents: 2
Suggesters: 1
Security: 0
Stars: 0
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- php: >=5.5
- zendframework/zend-inputfilter: >=2
Requires (Dev)
- phpunit/phpunit: ~5.6
This package is auto-updated.
Last update: 2024-11-11 14:44:16 UTC
README
Allow services as input-filters
-
Uses ZendFrameworks InputFilter config to build filters and validators from services from a general service container.
-
Requires special config values to be added to ZFs standard config format
-
Falls back to ZFs standard input filter factory
-
Utilizes config as:
[ 'test1' => [ 'name' => 'test1', 'required' => true, 'filters' => [ [ // Invoked 'name' => 'ZfInputFilterService\Filter\Test', 'options' => [ 'test' => 'filterOptionInvoked' ], ], [ // Service 'name' => 'ZfInputFilterService\Filter\TestService', 'service' => true, 'options' => [ 'test' => 'filterOptionService' ] ] ], 'validators' => [ [ // Invoked 'name' => 'ZfInputFilterService\Validator\Test', 'options' => [ 'test' => 'validatorOptionInvoked', 'messages' => [ 'TEST' => 'validatorMessageTemplateInvoked', ], ], ], [ // Service 'name' => 'ZfInputFilterService\Validator\TestService', 'service' => true, 'options' => [ 'test' => 'validatorOptionService', 'messages' => [ 'TEST' => 'validatorMessageTemplateService', ], ], ], ], ], // InputFilter Config Sevice 'subtest1' => [ // Service 'name' => 'subtest1', 'service' => true, 'type' => 'ZfInputFilterService\InputFilter\TestInputFilter', 'options' => [ 'test' => 'My test properties' ] ], ],
-
NOTE: This is a basic hack to get around the silly way ZF input filters and the factory are written