protected function walkCapture(CaptureNode $capture)
 {
     $variableNames = array();
     foreach ($capture->getBody() as $statement) {
         foreach ($this->walk($statement) as $name => $_) {
             $variableNames[$name] = true;
         }
     }
     return $variableNames;
 }
Exemple #2
0
 protected function walkCapture(CaptureNode $capture)
 {
     $ret = "ob_start();";
     foreach ($capture->getBody() as $statement) {
         $ret .= $this->walk($statement);
     }
     $resultSym = $this->gensym();
     $ret .= "{$resultSym} = ob_get_clean();";
     if ($capture->getName() !== null) {
         $ret .= "\$smarty->capture->{$capture->getName()} = {$resultSym};";
     }
     if ($capture->getAssign() !== null) {
         $ret .= "\${$capture->getAssign()} = {$resultSym};";
     }
     if ($capture->getAppend() !== null) {
         $ret .= "if (!isset(\${$capture->getAppend()})) { \${$capture->getAppend()} = array(); }";
         $ret .= "\${$capture->getAppend()}[] = {$resultSym};";
     }
     return $ret;
 }
 protected function walkCapture(CaptureNode $capture)
 {
     return new CaptureNode($capture->getName(), $capture->getAssign(), $capture->getAppend(), $this->walkEach($capture->getBody()));
 }
 protected function walkCapture(CaptureNode $capture)
 {
     $this->walkEachDisallow($capture->getBody(), "capture");
 }