filter() public method

public filter ( HamlNode $node )
$node HamlNode
Esempio n. 1
0
 public function filter(HamlNode $node)
 {
     if ($node === null) {
         throw new Exception('PHP filter: node is null');
     }
     $plainFilter = new PlainFilter();
     $output = $node->getSpaces() . "<?php\n";
     $output .= $plainFilter->filter($node);
     $output .= $node->getSpaces() . "?>";
     return $output . "\n";
 }
Esempio n. 2
0
 public function filter(HamlNode $node)
 {
     if (null === $node) {
         throw new Exception("CssFilter: node is null.");
     }
     $plainFilter = new PlainFilter();
     $output = $node->getSpaces() . "<style type=\"text/css\">\n";
     $oldLevel = $node->getIndentationLevel();
     $node->setIndentationLevel($oldLevel + 2);
     $output .= $plainFilter->filter($node);
     $node->setIndentationLevel($oldLevel);
     $output .= $node->getSpaces() . "</style>";
     return $output . "\n";
 }
Esempio n. 3
0
 public function filter(HamlNode $node)
 {
     if ($node === null) {
         throw new Exception('Javascript filter: node is null');
     }
     $plainFilter = new PlainFilter();
     $output = $node->getSpaces() . "<script type=\"text/javascript\">\n";
     $oldLevel = $node->getIndentationLevel();
     $node->setIndentationLevel($oldLevel + 2);
     $output .= $plainFilter->filter($node);
     $node->setIndentationLevel($oldLevel);
     $output .= $node->getSpaces() . "</script>";
     return $output . "\n";
 }