symfony2 - Cannot create symfony service -
i have created service in custom bundle in service.yml, requires entitymanager , 2 values parameters.yml.
example service.yml:
services: google.analytics.manager: class: cms\admindashboardbundle\manager\googleanalytics\googleanalyticsmanager arguments: ['@doctrine.orm.entity_manager','%ga.client.id%','%ga.key.name%']
i have file included dependcyinjection. far symfony still telling me phone call
$this->get('google.analytics.manager')
cannot find service. service helper in bundle (so not bundle class). bundle correctly set in appkernel. there i've missed?
thanks
yes, it's called controller. create work, had import directly, want avoid. service.yml included in cms\admindashboardbundle\dependcyinjection\cmsadmindashboardbundleextension.php.
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'); }
this should done symfony.
symfony2
No comments:
Post a Comment