public function registerViewHelpers()
{
$di = $this->getDI();
$cachePrefix = $this->getAppName();
$cacheFile = $this->getConfigPath() . "/_cache.{$cachePrefix}.helpers.php";
$helpers = $this->readCache($cacheFile);
if ($helpers) {
Tag::registerHelpers($helpers);
return $this;
}
$helpers = array();
$moduleManager = $di->getModuleManager();
$modules = $moduleManager->getModules();
foreach ($modules as $moduleName => $module) {
$moduleHelpers = $moduleManager->getModuleViewHelpers($moduleName);
if (is_array($moduleHelpers)) {
$helpers += $moduleHelpers;
}
}
Tag::registerHelpers($helpers);
if (!$di->getConfig()->debug && $helpers) {
$this->writeCache($cacheFile, $helpers);
}
return $this;
}