doctrine:
orm:
metadata_cache_driver:
type: xcache
namespace: %foobar%
안녕하세요, 저는 % foobar %와 같은 매개 변수를 통해 doctrine 캐시 네임 스페이스를 설정해야합니다. 매개 변수 %의는 foobar %의은을 통해 번들 클래스에 compilerPassSymfony 2 : Doctrine Cache 네임 스페이스
class FoobarCompiler implements CompilerPassInterface {
public function process(ContainerBuilder $container) {
$container->setParameter('foobar', uniqid());
}
}
이 compilerPass 인도 표준시 레지스터를 통해 설정됩니다 :
public function build(\Symfony\Component\DependencyInjection\ContainerBuilder $container) {
$container->addCompilerPass(new \FQNS\Compiler\FoobarCompiler());
}
하지만 난이 오류를 얻을 :
[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException] You have requested a non-existent parameter "foobar".
어떤 생각 방법을 이 매개 변수 "foobar"를 통해 교리 캐시 네임 스페이스를 설정할 수 있습니까?
class FoobarExtension extends Extension implements PrependExtensionInterface {
...
public function prepend(ContainerBuilder $container) {
$container->setParameter('foobar', uniqid());
}
}
는 "PrependExtensionInterface"인터페이스를 추가 할 수 importand입니다 :
greez & 들으, 하늘 ...