Exemplo n.º 1
0
 static function parse($tree)
 {
     extract($tree);
     if ($bool == '!') {
         $statement = "! ( {$statement} )";
     }
     $node = Block::parse($node);
     $children = Template::parse($children);
     return "<?php if ({$statement}): ?>{$node}{$children}<?php endif; ?>";
 }
Exemplo n.º 2
0
 static function parse($tree)
 {
     extract($tree);
     if (!$individual) {
         $individual = preg_match('/^\\$\\w+$/', $iterable) ? '$' . singular(trim($iterable, '$')) : '$item';
     }
     if ($individual == $iterable) {
         $individual = '$item';
     }
     $opening = "<?php foreach({$iterable} as \$i => {$individual}): ?>";
     $node = Block::parse($node);
     $children = Template::parse($children);
     $closing = "<?php endforeach; ?>";
     return $opening . $node . $children . $closing;
 }
Exemplo n.º 3
0
 protected static function setContent($content)
 {
     return is_array($content) ? Block::parse($content) : $content;
 }