B
B
BonBon Slick2018-03-25 20:21:24
symfony
BonBon Slick, 2018-03-25 20:21:24

How to create alias in XML markup?

<service id="League\Tactician\CommandBus"
        >
            <argument key="$middleware">
                <argument type="service"
                          id="tactician.commandbus.default"
                />
            </argument>
        </service>

//or

     <service id="League\Tactician\CommandBus"
        >
            <argument key="$middleware"
                      type="service"
                      id="tactician.commandbus.default"
            />
        </service>

Give an error
Type error: Argument 1 passed to League\Tactician\CommandBus::__construct() must be of the type 
array, string given, called in /home/vagrant/Code/symfony-simple-
adminka/var/cache/dev/ContainerFKJa0xU/getLogInControllerService.php on line 16

In .yaml markup, this is how it worked
League\Tactician\CommandBus: '@tactician.commandbus.default'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2018-03-27
@BonBonSlick

<service id="League\Tactician\CommandBus" alias="tactician.commandbus.default"/>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question