title: How to inject and use plugin in zend framework 3
body: <p>I've a controller  <code>Controller\Api\ProductController</code> for rest call and it's defined in <code>module.config.php</code></p>
  
  <pre><code>'controllers' =&gt; [
      'factories' =&gt; [
          Controller\Api\ProductController::class =&gt; function($container) {
              return new Controller\Api\ProductController(
                  $container-&gt;get(\Commerce\Model\Product::class), $container-&gt;get(\Commerce\Controller\Plugin\ProductPlugin::class)
              );
          }
      ]
  ]
  </code></pre>
  
  <p>In the above code you can see I'm injecting a  plugin class <code>\Commerce\Controller\Plugin\ProductPlugin::class</code> which is defined in <code>module.config.php</code></p>
  
  <pre><code>'controller_plugins' =&gt; [
      'factories' =&gt; [
          Controller\Plugin\ProductPlugin::class =&gt; InvokableFactory::class,
      ],
      'aliases' =&gt; [
          'product' =&gt; Controller\Plugin\ProductPlugin::class,
      ]
  ]
  </code></pre>
  
  <p>Now when I'm hitting the rest url it shows error message </p>
  
  <blockquote>
    <p>Unable to resolve service "Commerce\Controller\Plugin\ProductPlugin" to a
    factory; are you certain you provided it during configuration?</p>
  </blockquote>
  
  <p>What I'm missing ?</p>
  
  <p>Plugin code is</p>
  
  <pre><code>&lt;?php
  
  namespace Commerce\Controller\Plugin;
  
  use Zend\Mvc\Controller\Plugin\AbstractPlugin;
  
  class ProductPlugin extends AbstractPlugin
  {
  //....
  }
  </code></pre>