public
Created

  • Download Gist
app/config/config.yml
YAML
1 2 3 4 5 6
services:
dumb:
class: Acme\DumbService
arguments:
- "name"
- "hello": { "world": { "foo": %mailer_host% } }
output.txt
1 2 3 4 5 6 7
string 'name' (length=4)
array
'hello' =>
array
'world' =>
array
'foo' => string 'localhost' (length=9)
src/Acme/DemoBundle/Controller/DemoController.php
PHP
1 2 3 4 5 6
<?php
 
...
$dumb_service = $this->container->get('dumb');
$dumb_service->dump();
...
src/Acme/DumbService.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<?php
 
namespace Acme;
 
class DumbService
{
 
public function __construct($name, $options)
{
$this->name = $name;
$this->options = $options;
}
 
public function dump()
{
var_dump($this->name, $this->options);
}
 
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.