Comments (12)
Hello @dsoms
Adding the registry after require the $loader
is perfect.
Use the version ~1.0 of my validator, its for silex ~1.0
Regards dominikzogg
from dflydev-doctrine-orm-service-provider.
Hello @dsoms
One things, is the error, it seems the annotation is not loadable. There are to common reasons for this. First the annotation class is not available (did you installed symfony/validatior), the second the annotation registry is missing.
To get annotation validation running you need something like this:
https://github.com/saxulum/saxulum-validator-provider
Regards @dominikzogg
from dflydev-doctrine-orm-service-provider.
Hello @dominikzogg
1- symfony/validatior is installed
composer.json
{
"name": "fabpot/silex-skeleton",
"description": "A pre-configured skeleton for the Silex microframework",
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.3.3",
"silex/silex": "~1.0",
"silex/web-profiler": "~1.0",
"symfony/browser-kit": "~2.3",
"symfony/class-loader": "~2.3",
"symfony/config": "~2.3",
"symfony/console": "~2.3",
"symfony/css-selector": "~2.3",
"symfony/debug": "~2.3",
"symfony/finder": "~2.3",
"symfony/form": "~2.3",
"symfony/monolog-bridge": "~2.3",
"symfony/process": "~2.3",
"symfony/security": "~2.3",
"symfony/translation": "~2.3",
"symfony/twig-bridge": "~2.3",
"symfony/validator": "~2.3",
"doctrine/dbal": "2.*",
"symfony/doctrine-bridge": "2.*",
"dflydev/doctrine-orm-service-provider": "1.0.*@dev"
},
"autoload": {
"psr-0": { "": "src/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
}
}
2- I think the annotation registry is missing. I installed Silex with "fabpot/silex-skeleton". Which file I have to put this code?
<?php
$loader = require __DIR__ . '/../vendor/autoload.php';
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
3- I can't install saxulum-validator-provider, my Pimple version is 1.1.1 and is required >=2.1,<4
Regards @dsoms
from dflydev-doctrine-orm-service-provider.
If you really want to use the allready loaded doctrine bridge, take a look at: https://github.com/saxulum/saxulum-doctrine-orm-manager-registry-provider use the v2 its for silex ~1.0
from dflydev-doctrine-orm-service-provider.
Hi @dominikzogg
If I install the version ~1.0 of your validator, then also need the above code or I need the both?
<?php
$loader = require __DIR__ . '/../vendor/autoload.php';
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
Regards @dsoms
from dflydev-doctrine-orm-service-provider.
@dsoms yes
from dflydev-doctrine-orm-service-provider.
@dsoms you need it only ones, not ones foreach annotation using lib
from dflydev-doctrine-orm-service-provider.
Hi @dominikzogg
It works! Thank you very much for your help!
Finally I put the code in the file "src/app.php".
Regards @dsoms
from dflydev-doctrine-orm-service-provider.
@dsoms your welcome, would be cool if you close the issue
from dflydev-doctrine-orm-service-provider.
@dominikzogg One more thing, if I like to have UniqueEntity Constraint Support within Symfony Validator Component, I need to install saxulum-doctrine-orm-manager-registry-provider and saxulum-validator-provider or only the first one?
from dflydev-doctrine-orm-service-provider.
@dsoms you need both
from dflydev-doctrine-orm-service-provider.
Hi @dominikzogg
It works too! Again, thank you very much for your help!
Issue closed.
Regards @dsoms
from dflydev-doctrine-orm-service-provider.
Related Issues (20)
- Question: No Metadata Classes to process. HOT 20
- How do I install this? HOT 2
- Doctrine ODM implementation HOT 1
- PHP compatibility version HOT 2
- Uncaught exception 'InvalidArgumentException' with message 'Identifier "default" is not defined. HOT 2
- Issue with mappings
- Could you do an example with mysql connection? HOT 1
- Pimple requirement conflicts with silex HOT 5
- Incompatible with Silex ^1.3 HOT 9
- question : how to set redis options ? HOT 1
- Silex 2.0 compatibility HOT 1
- Registering an entity listener HOT 1
- shema upbdate problem HOT 1
- Register doctrine behavior HOT 2
- " HOT 1
- custom hydration not working HOT 1
- namestrategy not working
- Upgrade doctrine for JSON support
- lazyload connect to redis?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dflydev-doctrine-orm-service-provider.