Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7436191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:11:58+00:00 2026-05-29T10:11:58+00:00

1. Passing parameters into the service? If not already defined in the services.xml (or

  • 0

1. Passing parameters into the service?
If not already defined in the services.xml (or yaml), is the only way to pass parameter(s) into service is:

$container->setParameter('loader', $loader);
$container->get('myservice');

I suppose this way loader will be available to ALL services, not just “myservice”?

2. Passing an array of objects into the service?
The Template/DelegatingEngine class takes an array of engine object into the constructor, and I dont know how should I define that in the xml file:

public function __construct(array $engines = array())
    {
        $this->engines = array();
        foreach ($engines as $engine) {
            $this->addEngine($engine);
        }
    }

What should I put into the

<service id="myCustomeFramework.TemplateEngine" class="path\to\DelegateEngine" scope="prototype">
            <argument>how can i pass an array of engines here?</argument>
        </service> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:11:58+00:00Added an answer on May 29, 2026 at 10:11 am

    Answer 1

    Yes, it will be available for all services that uses that parameter and that are called after setting the parameter.

    Answer 2

    For passing an array as an argument to a service using xml you have to do it in this way:

    <service id="myCustomeFramework.TemplateEngine" class="path\to\DelegateEngine" scope="prototype">
        <argument type="collection">
            <argument key="key">value</argument>
            <argument key="key">value</argument>
            <argument key="key">value</argument>
        </argument>
    </service>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there any way to pass parameter into service from SESSION or other source?
I have read some posts on here about not mixing parameters when passing into
I have a new action in my controller that I'm passing parameters into so
what is the best practice or best way of passing form parameters from page
I need to pass an object as a parameter to the web service web
I am running into issues with passing parameters to managed beans in JSP within
I'm having trouble passing parameters into the GetAll method of my controller. I tried
I was passing parameters into a servlet to generate an excel spreadsheet. I then
ColdFusion code calls an ASP.NET web service passing the following parameters: Web service operation
I've recently run into interesting problem passing parameters to my controller action from my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.