zf3 zend navigation helper
<p>I'm trying to implement my zend navigation from a container in ZF3. I have successfully created navigation with this quick start tutorial introducing navigation directly in <code>config/autoload/global.php</code> or <code>config/module.config.php</code> files:</p>

<p><a href="https://docs.zendframework.com/zend-navigation/quick-start/" rel="nofollow noreferrer">https://docs.zendframework.com/zend-navigation/quick-start/</a></p>

<p>But now I need to make it work these with the helpers to allow navigation modifications from the controller, using the "Navigation setup used in examples" section:</p>

<p><a href="https://docs.zendframework.com/zend-navigation/helpers/intro/" rel="nofollow noreferrer">https://docs.zendframework.com/zend-navigation/helpers/intro/</a></p>

<p>This is my <strong>Module.php</strong></p>

<pre><code>namespace Application;

use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\View\HelperPluginManager;

class Module implements ConfigProviderInterface
{
    public function getViewHelperConfig()
    {
        return [
            'factories' =&gt; [
                // This will overwrite the native navigation helper
                'navigation' =&gt; function(HelperPluginManager $pm) {
                    // Get an instance of the proxy helper
                    $navigation = $pm-&gt;get('Zend\View\Helper\Navigation');
                    // Return the new navigation helper instance
                    return $navigation;
                }
            ]
        ];
    }

    public function getControllerConfig()
    {
        return [
            'factories' =&gt; [
                        $this-&gt;getViewHelperConfig()
                    );
                },
            ],
        ];
    }
}
</code></pre>

<p>And this is my <strong>IndexController.php</strong></p>

<pre><code>namespace Application\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Navigation\Navigation;
use Zend\Navigation\Page\AbstractPage;

class IndexController extends AbstractActionController
{

    private $navigationHelper;

    public function __construct(
        $navigationHelper    
    ){
        $this-&gt;navigationHelper = $navigationHelper;
    }

    public function indexAction()
    {

        $container = new Navigation();
        $container-&gt;addPage(AbstractPage::factory([
            'uri' =&gt; 'http://www.example.com/',
        ]));

        $this-&gt;navigationHelper-&gt;plugin('navigation')-&gt;setContainer($container);

        return new ViewModel([
        ]);
    }


}
</code></pre>

<p>But then I get the following error:</p>

<pre><code>Fatal error: Call to a member function plugin() on array in /var/www/html/zf3/module/Application/src/Controller/IndexController.php on line 50
</code></pre>

<p>In the tutorial they use the following statement:</p>

<pre><code>// Store the container in the proxy helper:
$view-&gt;plugin('navigation')-&gt;setContainer($container);

// ...or simply:
$view-&gt;navigation($container);
</code></pre>

<p>But I don´t know what this <code>$view</code> is, so I assume is my <code>$navigation</code> from my <strong>Module.php</strong>. The problem is that, because is an array, it throws the error. The questions are:</p>

<ul>
<li>What am I doing wrong?</li>
<li>Where this <code>$view</code> of the tutorial come from?</li>
<li>What I should pass from my <strong>Module.php</strong> to get it work?</li>
</ul>

<p>Thanks in advance!</p>