TYPO3 CMS  TYPO3_6-2
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 = array();
25 
31  public function __construct($internalArray) {
32  $this->internalArray = $internalArray;
33  }
34 
41  public function evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext) {
42  $arrayToBuild = array();
43  foreach ($this->internalArray as $key => $value) {
44  if ($value instanceof \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode) {
45  $arrayToBuild[$key] = $value->evaluate($renderingContext);
46  } else {
47  // TODO - this case should not happen!
48  $arrayToBuild[$key] = $value;
49  }
50  }
51  return $arrayToBuild;
52  }
53 
59  public function getInternalArray() {
60  return $this->internalArray;
61  }
62 }
evaluate(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
Definition: ArrayNode.php:41