Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo
- {
- private $config;
- /**
- * @param Config $config
- */
- public function __construct(Config $config) {
- $this->config = $config->getData();
- }
- }
- config:
- ...
- foo:
- class: KopernikusLeBundleServiceFoo
- arguments:
- - @config
- foo:
- class: KopernikusLeBundleServiceFoo
- arguments:
- - [@config, getData]
- config:
- ...
- foo:
- class: KopernikusLeBundleServiceFoo
- arguments: ["@=service('config').getData()"]
- <?php
- class FooContainer implements YourContainerInterface {
- public static function get() {
- // Config logic here
- return new Foo($config);
- }
- }
Add Comment
Please, Sign In to add comment