Created
February 28, 2014 11:08
-
-
Save tfountain/9269259 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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