Compiler.php
private function _processModifiers($expression) {
        $mStart  = '';
        $mEnd    = '';
        $rawEcho = false;

        /** process modifiers */
        if (strpos($expression, '|') !== false && strpos($expression, '||') === false) {
            $modifiers  = explode('|', $expression);
            $expression = array_shift($modifiers);
            foreach ($modifiers as $modifier) {
                $params = array();
                if (strpos($modifier, ':') !== false) {
                    $params   = explode(':', $modifier);
                    $modifier = array_shift($params);
                }
                if ($modifier == 'raw') {
                    $rawEcho = true;
                    continue;
                }

                if ($this->isCallable($modifier)) {
                    $mStart = $modifier . '(' . $mStart;
                    if ($modifier !== 'raw') {
                        foreach ($params as $param) {
                            $mEnd .= ', ' . $this->compileExpression($param);
                        }
                    }
                    $mEnd .= ')';
                } else {
                    throw new \Exception('SLOT compiler error: undefined modifier ' . $modifier);
                }
            }
        }

        return array(
            $expression,
            $mStart,
            $mEnd,
            $rawEcho
        );
    }
private function _processModifiers($expression) {
        $mStart  = '';
        $mEnd    = '';
        $rawEcho = false;

        /** process modifiers */
        if (strpos($expression, '|') !== false && strpos($expression, '||') === false) {
            $modifiers  = explode('|', $expression);
            $expression = array_shift($modifiers);
            foreach ($modifiers as $modifier) {
                $params = array();
                if (strpos($modifier, ':') !== false) {
                    $params   = explode(':', $modifier);
                    $modifier = array_shift($params);
                }
                if ($modifier == 'raw') {
                    $rawEcho = true;
                    continue;
                }

                if ($this->isCallable($modifier)) {
                    $mStart = $modifier . '(' . $mStart;
                    if ($modifier !== 'raw') {
                        foreach ($params as $param) {
                            $mEnd .= ', ' . $this->compileExpression($param);
                        }
                    }
                    $mEnd .= ')';
                } else {
                    throw new \Exception('SLOT compiler error: undefined modifier ' . $modifier);
                }
            }
        }

        return array(
            $expression,
            $mStart,
            $mEnd,
            $rawEcho
        );
    }
private function _processModifiers ( $ expression ) { $ mStart = '' ; $ mEnd = '' ; $ rawEcho = false ; /** process modifiers */ if ( strpos ( $ expression , '|' ) !== false && strpos ( $ expression , '||' ) === false ) { $ modifiers = explode ( '|' , $ expression ) ; $ expression = array_shift ( $ modifiers ) ; foreach ( $ modifiers as $ modifier ) { $ params = array ( ) ; if ( strpos ( $ modifier , ':' ) !== false ) { $ params = explode ( ':' , $ modifier ) ; $ modifier = array_shift ( $ params ) ; } if ( $ modifier == 'raw' ) { $ rawEcho = true ; continue ; } if ( $ this -> isCallable ( $ modifier ) ) { $ mStart = $ modifier . '(' . $ mStart ; if ( $ modifier !== 'raw' ) { foreach ( $ params as $ param ) { $ mEnd .= ', ' . $ this -> compileExpression ( $ param ) ; } } $ mEnd .= ')' ; } else { throw new \ Exception ( 'SLOT compiler error: undefined modifier ' . $ modifier ) ; } } } return array ( $ expression , $ mStart , $ mEnd , $ rawEcho ) ; }
Add modifier surrounding for expression
@param $expression
@return array
@throws \Exception
Add modifier surrounding for expression