76 $this->
registerArgument(
'id',
'string',
'Translation Key compatible to TYPO3 Flow');
77 $this->
registerArgument(
'default',
'string',
'if the given locallang key could not be found, this value is used. If this argument is not set, child nodes will be used to render the default');
78 $this->
registerArgument(
'htmlEscape',
'boolean',
'TRUE if the result should be htmlescaped. This won\'t have an effect for the default value');
79 $this->
registerArgument(
'arguments',
'array',
'Arguments to be replaced in the resulting string');
80 $this->
registerArgument(
'extensionName',
'string',
'UpperCamelCased extension key (for example BlogExample)');
91 $id = $this->
hasArgument(
'id') ? $this->arguments[
'id'] : $this->arguments[
'key'];
93 if (strlen($id) > 0) {
96 throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException(
'An argument "key" or "id" has to be provided', 1351584844);
107 $request = $this->controllerContext->getRequest();
108 $extensionName = $this->arguments[
'extensionName'] === NULL ? $request->getControllerExtensionName() : $this->arguments[
'extensionName'];
110 if ($value === NULL) {
111 $value = $this->arguments[
'default'] !== NULL ? $this->arguments[
'default'] : $this->
renderChildren();
112 if (is_array($this->arguments[
'arguments'])) {
113 $value = vsprintf($value, $this->arguments[
'arguments']);
115 } elseif ($this->arguments[
'htmlEscape']) {
116 $value = htmlspecialchars($value);
hasArgument($argumentName)
registerArgument($name, $type, $description, $required=FALSE, $defaultValue=NULL)
static translate($key, $extensionName, $arguments=NULL)