An open API service indexing awesome lists of open source software.

https://github.com/heavenshell/php-silex-zf-validate

Silex Zend Validate extension
https://github.com/heavenshell/php-silex-zf-validate

Last synced: over 1 year ago
JSON representation

Silex Zend Validate extension

Awesome Lists containing this project

README

          

Zend_Validate extension.

This extension for the Silex microframework enables use Zend Framework's Zend_Validate.

register(new \Zf1\ValidateExtension(), array(
'zend.class_path' => $zendpath,
));

$app->get('/error', function () use ($app) {
$validator = $app['zend.validate']('alnum');
$result = $validator->isvalid('abcd++');
if ($result === false) {
$mssages = $validator->getMessages();
var_dump($messages);
}

return $result;
});

Notice:
Running tests or examples code
1. Set Zend Framework1 library to your include_path export ZF_PATH='/path/to/zf1/path'
2. export include_path
$ export ZF_PATH='/path/to/zf1/path'