I can do so:
// View
<div>
<?php echo $this->myHelper($this); ?>
</div>
// View helper
public function __invoke($view)
{
...
return $view->partial('page_nav', $someData);
}
Can I get view object in view helper without passing it as a parameter in view? Like this:
// View
<div>
<?php echo $this->myHelper(); ?>
</div>
// View Helper factory
public function createService(ServiceLocatorInterface $pluginManager)
{
...
$view = foo(); // maybe here I can get view?
return new myHelper($view);
}
// View helper
public function __invoke()
{
...
$view = $this->view;
return $view->partial('page_nav', $someData);
}