Validation Class not found

943 views Asked by At

I am using symfony2 validator component. I have downloaded zip files from pear.symfony.com. Unzipped files and now my directory structure is as following.

-Symfony
-index.php


index.php has following code to just test that validation class is being included.

<?php

use Symfony\Component\Validator\Validation;
use Symfony\Component\Validator\Constraints\Length;

$validator = Validation::createValidator();
$violations = $validator->validateValue('Bernhard', new Length(array('min' => 10)));

?>

But getting following error:

Fatal error: Class 'Symfony\Component\Validator\Validation' not found in  
C:\xampp\htdocs\labeeb-projects\testing symfony2 components\index.php on line 10
0

There are 0 answers