PlainFilter::filter PHP Method

filter() public method

public filter ( HamlNode $node )
$node HamlNode
    public function filter(HamlNode $node)
    {
        if (null === $node) {
            throw new Exception("PlainFilter: node is null.");
        }
        $children = $node->getChildren();
        $output = '';
        foreach ($children as $childNode) {
            $output .= $this->renderChildrenHaml($childNode);
        }
        return $output;
    }

Usage Example

Example #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";
 }
All Usage Examples Of PlainFilter::filter