title: Symfony 2 Service Parameters
body: <p>One of the parameters I want to pass to a service when creating it is a result of a string calculation based on some user inputs. How can this be achieved automagically such that I do not have to pass the values into the object every time I want to access it from a different controller?</p>
  
  <p>Just to illustrate I am adding the following example:</p>
  
  <p>I have encapsulated the Instagram API in a Service by following the Documentation (brilliant), so writing <code>$instagram  = $this-&gt;get('instagram');</code> in my code <strong>almost</strong> works, as for the communication with the API I need to also set a callback URL, which I currently always have to do after the service is retrieved, for eg:</p>
  
  <pre><code>    $redirect_url   = $this-&gt;getRequest()-&gt;getSchemeAndHttpHost().$this-&gt;generateUrl('_instagram_authenticate_response');
      $instagram      = $this-&gt;get('instagram');
      $instagram-&gt;setApiCallback($redirect_url);
  </code></pre>
  
  <p>It is okay to do this once, but not in every freaking method I use when I talk to instagram. Please help :)</p>
  
  <p>Update: My Service definition is as follows:</p>
  
  <pre><code>parameters:
      client_id: xxxxx
      client_secret: yyyyy
  
  services:
      instagram:
          class: Clops\InstagramBundle\InstagramAPI
          arguments: ["%client_id%", "%client_secret%"]
  </code></pre>
  
  <p>The question is --> how do I pass the third parameter as a value generated in a controller? Or do I always have to do this via setValue(X) after I get the service?</p>