*
*
*
*
* {wrap.0}{menuItem.title}{wrap.1}
*
*
* {wrap.0 -> f:if(condition: settings.wrapBefore)}{menuItem.title}{wrap.1 -> f:if(condition: settings.wrapAfter)}
*
* @author Claus Due
* @package Vhs
* @subpackage ViewHelpers\Var
*/
class TyposcriptViewHelper extends AbstractViewHelper {
/**
* @var ConfigurationManagerInterface
*/
protected $configurationManager;
/**
* @param ConfigurationManagerInterface $configurationManager
* @return void
*/
public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager) {
$this->configurationManager = $configurationManager;
}
/**
* Render
*
* @param string $path
* @return mixed
*/
public function render($path = NULL) {
if (NULL === $path) {
$path = $this->renderChildren();
}
if (TRUE === empty($path)) {
return NULL;
}
$all = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$segments = explode('.', $path);
$value = $all;
foreach ($segments as $path) {
$value = (TRUE === isset($value[$path . '.']) ? $value[$path . '.'] : $value[$path]);
}
if (TRUE === is_array($value)) {
$value = GeneralUtility::removeDotsFromTS($value);
}
return $value;
}
}