8000 Fixed some wrong examples about service config by javiereguiluz · Pull Request #10087 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Fixed some wrong examples about service config #10087

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
Jul 19, 2018
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
10 changes: 5 additions & 5 deletions service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -880,27 +880,27 @@ for classes under the same namespace:

.. code-block:: yaml

# app/config/services.yml
# config/services.yaml
services:
App\Domain\:
resource: '../../src/Domain/*'
resource: '../src/Domain/*'
# ...

In order to have multiple definitions, add the ``namespace`` option and use any
unique string as the key of each service config:

.. code-block:: yaml

# app/config/services.yml
# config/services.yaml
services:
command_handlers:
namespace: App\Domain\
resource: '../../src/Domain/*/CommandHandler'
resource: '../src/Domain/*/CommandHandler'
tags: [command_handler]

event_subscribers:
namespace: App\Domain\
resource: '../../src/Domain/*/EventSubscriber'
resource: '../src/Domain/*/EventSubscriber'
tags: [event_subscriber]

.. _services-explicitly-configure-wire-services:
< 8000 tool-tip id="tooltip-61528f32-c533-43b0-9077-5f671c2ce3fb" for="expand-down-link--diff-d04c87e383145fdfa08f0836fb162da20532bfb78bf3f412fb70407464360340" popover="manual" data-direction="ne" data-type="label" data-view-component="true" class="sr-only position-absolute">Expand Down
6 changes: 3 additions & 3 deletions service_container/service_subscribers_locators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ service type to a service.

.. code-block:: yaml

// app/config/services.yml
// config/services.yaml
services:
App\CommandBus:
tags:
- { name: 'container.service_subscriber', key: 'logger', id: 'monolog.logger.event' }

.. code-block:: xml

<!-- app/config/services.xml -->
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -227,7 +227,7 @@ service type to a service.

.. code-block:: php

// app/config/services.php
// config/services.php
use App\CommandBus;

// ...
Expand Down
0