title: Symfony - Create Service object with parameters
body: <p>I created a new service in my symfony application:</p>
  
  <pre><code>namespace AppBundle\Service;
  
  class CustomService {
  
      public function __construct($username, $password) {
          // stuff
      }
  
      public function getItems() {
  
      }
  
  }
  </code></pre>
  
  <p>and configured in config.yml:</p>
  
  <pre><code>services:
      custom_service:
          class:          AppBundle\Service\CustomService
  </code></pre>
  
  <p>My question is, how to create an object from this service with multiple arguments?</p>
  
  <p>Like:</p>
  
  <pre><code>namespace AppBundle\Controller;
  
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Request;
  
  class CustomController extends Controller {
  
      public function listAction() {
  
          $custom_service = $this-&gt;get('custom_service'); //how to pass multiple arguments here?
  
          // Next i would use my custom service, like:
          $items = $custom_service-&gt;getItems();
  
      }
  
  }
  </code></pre>
  
  <p>Anybody knows how to solve this issue?</p>
  
  <p>Thanks and Greetings!</p>