whitebear
whitebear

Reputation: 12433

What the templating service ID?

I want to pass the templating EngineInterface to constructor.

Since ,I want to use renderView() from the class which is not controller class.

public function __construct(FormInterface $form, Request $request, UserManagerInterface $userManager, MailerInterface $mailer,TokenGeneratorInterface $tokenGenerator,GroupManagerInterface $groupManager,EngineInterface $templating)
{

    parent::__construct($form, $request, $userManager, $mailer,$tokenGenerator);
    $this->groupManager = $groupManager;  
    $this->templating = $templating;
}

my current service.xml is this

    <service id="acme_user.registration.form.handler" class="Acme\UserBundle\Form\Handler\RegistrationFormHandler" scope="request" public="false">  
        <argument type="service" id="fos_user.registration.form" />  
        <argument type="service" id="request" />  
        <argument type="service" id="fos_user.user_manager" />  
        <argument type="service" id="fos_user.mailer" />
        <argument type="service" id="fos_user.util.token_generator" />
        <argument type="service" id="fos_user.group_manager" />  
        <argument type="service" id="****" />  <!-- what is templating service iD?  
    </service> 

What is the templating service ID?

and generally speaking,how can I find the service id ?

Upvotes: 1

Views: 485

Answers (2)

Udan
Udan

Reputation: 5609

You are probably looking for :

<argument type="service" id="templating"/>

Upvotes: 4

bjuice
bjuice

Reputation: 291

You can find the service id via the console:

php app/console container:debug

The service you are looking for is called 'templating'.

Upvotes: 4

Related Questions