Le 11/03/2011 11:56, Miha Vrhovnik a écrit :
While we are at this.
Having code below in extension load method as written by Dan doesn't
actually work:
$namespaces =
$configuration->getParameter('validator.annotations.namespaces');
$namespaces['validationStore'] =
'Application\\StoreBundle\\Validator\\Constraints\\';
$configuration->setParameter('validator.annotations.namespace',
$namespaces);
I hate having namespace definition in main config.yml (works)
validation:
enabled: true
annotations: true
namespaces:
validationStore:
Application\StoreBundle\Validator\Constraints\
I'd prefer having it defined in xml file that is loaded by load
method. But written as below doesn't work as it requires to repeat any
annotation defined by any other Bundle.
<parameters>
<parameter key="validator.annotations.namespaces" type="collection">
<parameter
key="validationStore">Application\StoreBundle\Validator\Constraints\</parameter>
</parameter>
</parameters>
Regards,
The issue here is that these are two different thing. The first one
provide the configuration loaded by the FrameworkExtension which
contains some logic for this. The second syntax sets a parameter in the
DIC directly which means you overwrite the core validation namespace
unless you redefine it explicitly in the collection.
Why do you hate having the configuration defined in the config.yml file
? This is exactly what it is for.
--
Christophe | Stof
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en