Dieser Code arbeitete für Symfony 2.4.5 aber es funktioniert nicht für Symfony 2.5:Wie teilt man Validierung Yaml-Dateien in Symfony 2.5?
Das ist meine HRAPI Erweiterung Klasse, die es in Symfony 2.4.5 aber nicht in Symfony 2,5
<?php
namespace HardCoreMore\HRAPIBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class HRAPIExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
// load validation configuration
$yamlMappingFiles = $container->getParameter('validator.mapping.loader.yaml_files_loader.mapping_files');
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/site_user.yml';
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/human_resource.yml';
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/tag.yml';
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/company.yml';
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/programming_language.yml';
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/technology.yml';
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/language.yml';
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/management.yml';
$yamlMappingFiles[] = __DIR__.'/../Resources/config/validation/calendar_entry.yml';
$container->setParameter('validator.mapping.loader.yaml_files_loader.mapping_files', $yamlMappingFiles);
}
}
arbeitet zeigt Fehler an:
ParameterNotFoundException: You have requested a non-existent parameter "validator.mapping.loader.yaml_files_loader.mapping_files".
Irgendwelche Ideen, wie man es für Symfony 2.5 macht?
Können Sie näher ausführen "funktioniert nicht"? – Maerlyn
Ich habe die Frage aktualisiert. Es heißt 'ParameterNotFoundException: Sie haben einen nicht vorhandenen Parameter "validator.mapping.loader.yaml_files_loader.mapping_files" angefordert.' –