Skip to content

[Dependency Injection] small changes #1860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/dependency_injection/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,18 @@ the service itself gets loaded. To do so, you can use the ``file`` directive.
services:
foo:
class: Example\Foo\Bar
file: "%kernel.root_dir%/src/path/to/file/foo.php"
file: "%app.root_dir%/src/path/to/file/foo.php"

.. code-block:: xml

<service id="foo" class="Example\Foo\Bar">
<file>%kernel.root_dir%/src/path/to/file/foo.php</file>
<file>%app.root_dir%/src/path/to/file/foo.php</file>
</service>

.. code-block:: php

$definition = new Definition('Example\Foo\Bar');
$definition->setFile('%kernel.root_dir%/src/path/to/file/foo.php');
$definition->setFile('%app.root_dir%/src/path/to/file/foo.php');
$container->setDefinition('foo', $definition);

Notice that symfony will internally call the PHP function require_once
Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ worlds though by using configuration files and then dumping and caching the resu
configuration. The ``PhpDumper`` makes dumping the compiled container easy::

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Dumper\PhpDumper
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;

$file = __DIR__ .'/cache/container.php';

Expand Down