Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dynamic settings injection 1/4, before eZ 5.4 / 2014.09
parameters:
acme_test.my_service.class: Acme\TestBundle\MyServiceClass
services:
acme_test.my_service:
class: %acme_test.my_service.class%
arguments: [@ezpublish.config.resolver]
<?php
namespace Acme\TestBundle;
use eZ\Publish\Core\MVC\ConfigResolverInterface;
class MyServiceClass
{
/**
* @var ConfigResolverInterface
*/
private $configResolver;
public function __construct( ConfigResolverInterface $configResolver )
{
$this->configResolver = $configResolver
}
public function doSomethingWithLanguages()
{
$languages = $this->configResolver->getParameter( 'languages' );
// Do something...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.