Skip to content

Instantly share code, notes, and snippets.

@tfountain
Created February 28, 2014 11:08
Show Gist options
  • Save tfountain/9269259 to your computer and use it in GitHub Desktop.
Save tfountain/9269259 to your computer and use it in GitHub Desktop.
<?php
namespace QDFileupload\View\Helper;
use Zend\View\Helper\AbstractHelper;
class QDFileuploadCollectionHelper extends AbstractHelper
{
protected $thingy;
public function __construct($thingy)
{
$this->thingy = $thingy;
}
public function __invoke()
{
// you can now access $this->thingy
}
}
public function getViewHelperConfig()
{
return array(
'factories' => array(
'qdfileuploadCollection' => function ($helperPluginManager) {
$sm = $helperPluginManager->getServiceLocator();
$thingy = $sm->get('Thingy');
$helper = new QDFileupload\View\Helper\QDFileuploadCollectionHelper($thingy);
return $helper;
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment