bobthecow/mustache.php — pull request #149 by Placebo (2013-05-08 06:54:48+00:00)
Title: $mustache should be public

be cause of this code works :
(for zf2 view helper usage)
public function addBasePath(MvcEvent $e) {
$viewModel = $e->getViewModel();
$variables = $viewModel->getVariables();
$mustacheEngine = $e->getApplication()->getServiceManager()->get('mustacheviewrenderer')->getEngine();
$basePathHelper = $e->getApplication()->getServiceManager()->get('viewhelpermanager')->get('basepath');
$mustacheEngine->zendHelpers['basepath'] = $basePathHelper;
$mustacheEngine->addHelper('basePath', function($text,$mustache) {
// global $basePathHelper;
$basepathhelper = $mustache->mustache->zendHelpers['basepath'];
return $basepathhelper->__invoke($text);
});

}