Flow\Expression\FilterExpression::compile PHP Method

compile() public method

public compile ( $compiler, $indent )
    public function compile($compiler, $indent = 0)
    {
        static $raw = 'raw';
        $safe = false;
        $postponed = array();
        foreach ($this->filters as $i => $filter) {
            if ($filter[0] == $raw) {
                $safe = true;
                break;
            }
        }
        if ($this->autoEscape && !$safe) {
            $this->appendFilter(array('escape', array()));
        }
        for ($i = count($this->filters) - 1; $i >= 0; --$i) {
            if ($this->filters[$i] === 'raw') {
                continue;
            }
            list($name, $arguments) = $this->filters[$i];
            if ($name == $raw) {
                continue;
            }
            $compiler->raw('$this->helper(\'' . $name . '\', ');
            $postponed[] = $arguments;
        }
        $this->node->compile($compiler);
        foreach (array_reverse($postponed) as $i => $arguments) {
            foreach ($arguments as $arg) {
                $compiler->raw(', ');
                $arg->compile($compiler);
            }
            $compiler->raw(')');
        }
    }