public function removeBlock($type)
    {
        if ($this->debug) {
            echo 'Compiler::' . __FUNCTION__ . "\n";
        }

        $output = '';

        $pluginType = $this->getPluginType($type);
        if ($pluginType & Core::SMARTY_BLOCK) {
            $type = 'Smartyinterface';
        }
        while (true) {
            while ($top = array_pop($this->stack)) {
                if ($top['custom']) {
                    $class = $top['class'];
                } else {
                    $class = current(array_filter([
                        'Plugin' . Core::toCamelCase($top['type']),
                        Core::NAMESPACE_PLUGINS_BLOCKS . 'Plugin' . Core::toCamelCase($top['type'])
                    ], 'class_exists'));
                }
                if (count($this->stack)) {
                    $this->curBlock = &$this->stack[count($this->stack) - 1];
                    $this->push(call_user_func(array(
                        $class,
                        'postProcessing'
                    ), $this, $top['params'], '', '', $top['buffer']), 0);
                } else {
                    $null           = null;
                    $this->curBlock = &$null;
                    $output         = call_user_func(
                        array(
                        $class,
                        'postProcessing'
                        ), $this, $top['params'], '', '', $top['buffer']
                    );
                }

                if ($top['type'] === $type) {
                    break 2;
                }
            }

            throw new CompilationException($this, 'Syntax malformation, a block of type "' . $type . '" was closed but was not opened');
        }

        return $output;
    }
public function removeBlock($type)
    {
        if ($this->debug) {
            echo 'Compiler::' . __FUNCTION__ . "\n";
        }

        $output = '';

        $pluginType = $this->getPluginType($type);
        if ($pluginType & Core::SMARTY_BLOCK) {
            $type = 'Smartyinterface';
        }
        while (true) {
            while ($top = array_pop($this->stack)) {
                if ($top['custom']) {
                    $class = $top['class'];
                } else {
                    $class = current(array_filter([
                        'Plugin' . Core::toCamelCase($top['type']),
                        Core::NAMESPACE_PLUGINS_BLOCKS . 'Plugin' . Core::toCamelCase($top['type'])
                    ], 'class_exists'));
                }
                if (count($this->stack)) {
                    $this->curBlock = &$this->stack[count($this->stack) - 1];
                    $this->push(call_user_func(array(
                        $class,
                        'postProcessing'
                    ), $this, $top['params'], '', '', $top['buffer']), 0);
                } else {
                    $null           = null;
                    $this->curBlock = &$null;
                    $output         = call_user_func(
                        array(
                        $class,
                        'postProcessing'
                        ), $this, $top['params'], '', '', $top['buffer']
                    );
                }

                if ($top['type'] === $type) {
                    break 2;
                }
            }

            throw new CompilationException($this, 'Syntax malformation, a block of type "' . $type . '" was closed but was not opened');
        }

        return $output;
    }
public function removeBlock ( $ type ) { if ( $ this -> debug ) { echo 'Compiler::' . __FUNCTION__ . "\n" ; } $ output = '' ; $ pluginType = $ this -> getPluginType ( $ type ) ; if ( $ pluginType & Core :: SMARTY_BLOCK ) { $ type = 'Smartyinterface' ; } while ( true ) { while ( $ top = array_pop ( $ this -> stack ) ) { if ( $ top [ 'custom' ] ) { $ class = $ top [ 'class' ] ; } else { $ class = current ( array_filter ( [ 'Plugin' . Core :: toCamelCase ( $ top [ 'type' ] ) , Core :: NAMESPACE_PLUGINS_BLOCKS . 'Plugin' . Core :: toCamelCase ( $ top [ 'type' ] ) ] , 'class_exists' ) ) ; } if ( count ( $ this -> stack ) ) { $ this -> curBlock = & $ this -> stack [ count ( $ this -> stack ) - 1 ] ; $ this -> push ( call_user_func ( array ( $ class , 'postProcessing' ) , $ this , $ top [ 'params' ] , '' , '' , $ top [ 'buffer' ] ) , 0 ) ; } else { $ null = null ; $ this -> curBlock = & $ null ; $ output = call_user_func ( array ( $ class , 'postProcessing' ) , $ this , $ top [ 'params' ] , '' , '' , $ top [ 'buffer' ] ) ; } if ( $ top [ 'type' ] === $ type ) { break 2 ; } } throw new CompilationException ( $ this , 'Syntax malformation, a block of type "' . $ type . '" was closed but was not opened' ) ; } return $ output ; }
Removes the closest-to-top block of the given type and all other
blocks encountered while going down the block stack.

@param string $type block type (name)

@return string the output of all postProcessing() method's return values of the closed blocks
@throws CompilationException
Removes the closest - to - top block of the given type and all other blocks encountered while going down the block stack .