title: ZF2 - ServiceManager dependencies into Controllers
body: <p>I'm attempting to convert my beta DI code to the release version of ZF2.
  Right now I'm falling over at the very start and there doesn't seem to be any sort of documentation about injecting stuff into the controllers which gets me to think that it's not normal to have dependencies in a controller?</p>
  
  <p>Right now I'm just doing a <code>var_dump('blah');exit;</code> just to try and get some code to run...
  I've tried a number of things and right now I expected this to work:</p>
  
  <p>module.config.php</p>
  
  <pre><code>'controllers' =&gt; array(
      'invokables' =&gt; array(
          'indexController' =&gt; 'Application\Controller\IndexController',
      )
  )
  </code></pre>
  
  <p>Module.php</p>
  
  <pre><code>public function getControllerConfig() {
      return array(
          'factories' =&gt; array(
              'indexController'    =&gt; function(ControllerManager $cm) {
                  var_dump('blah');exit;
              },
          ),
      );
  }
  </code></pre>
  
  <p>Right now nothing is happening and it's pretty frustrating... I read something about creating Factories for each Controller but I have 33 and I find that quite insane and stupid... ?</p>
  
  <p>What I'm trying to inject is stuff like a userMapper for grabbing/saving users. So the registerAction creates a user in the database using the userMapper and when you try to login it uses the userMapper to check if there is a user there etc.</p>