TYPO3 CMS  TYPO3_6-2
JsonEncodeViewHelper.php
Go to the documentation of this file.
1 <?php
3 
22 
28  public function __construct() {
29  $this->registerArgument('additionalAttributes', 'array', 'Additional tag attributes. They will be added directly to the resulting HTML tag.', FALSE);
30  }
31 
38  public function render() {
39  if ($this->hasArgument('additionalAttributes') && is_array($this->arguments['additionalAttributes'])) {
40  return json_encode($this->arguments['additionalAttributes']);
41  }
42  $content = $this->renderChildren();
43  return json_encode($content);
44  }
45 
46 }
registerArgument($name, $type, $description, $required=FALSE, $defaultValue=NULL)