Esempio n. 1
0
 /**
  * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode $node
  * @return array
  * @see convert()
  */
 protected function convertBooleanNode(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode $node)
 {
     $initializationPhpCode = '// Rendering Boolean node' . chr(10);
     if ($node->getComparator() !== NULL) {
         $convertedLeftSide = $this->convert($node->getLeftSide());
         $convertedRightSide = $this->convert($node->getRightSide());
         return array('initialization' => $initializationPhpCode . $convertedLeftSide['initialization'] . $convertedRightSide['initialization'], 'execution' => sprintf('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\BooleanNode::evaluateComparator(\'%s\', %s, %s)', $node->getComparator(), $convertedLeftSide['execution'], $convertedRightSide['execution']));
     } else {
         // simple case, no comparator.
         $converted = $this->convert($node->getSyntaxTreeNode());
         return array('initialization' => $initializationPhpCode . $converted['initialization'], 'execution' => sprintf('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\BooleanNode::convertToBoolean(%s)', $converted['execution']));
     }
 }