TYPO3 CMS  TYPO3_7-6
ArrayNode.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
13 
18 {
24  protected $internalArray = [];
25 
31  public function __construct($internalArray)
32  {
33  $this->internalArray = $internalArray;
34  }
35 
42  public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
43  {
44  $arrayToBuild = [];
45  foreach ($this->internalArray as $key => $value) {
46  if ($value instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode) {
47  $arrayToBuild[$key] = $value->evaluate($renderingContext);
48  } else {
49  // @todo - this case should not happen!
50  $arrayToBuild[$key] = $value;
51  }
52  }
53  return $arrayToBuild;
54  }
55 
61  public function getInternalArray()
62  {
63  return $this->internalArray;
64  }
65 }
evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
Definition: ArrayNode.php:42