code/template/filter/block.php
protected function _renderBlocks($name, $attribs = array())
    {
        $html   = '';
        $count  = 1;
        $blocks = $this->getBlocks($name);

        foreach($blocks as $block)
        {
            //Set the block attributes
            if($count == 1) {
                $attribs['rel']['first'] = 'first';
            }

            if($count == count($blocks)) {
                $attribs['rel']['last'] = 'last';
            }

            if(isset($block['attribs'])) {
                $block['attribs'] = array_merge((array) $block['attribs'], $attribs);
            } else {
                $block['attribs'] = $attribs;
            }

            //Render the block
            $content = $this->_renderBlock($block);

            //Prepend or append the block
            if($block['extend'] == 'prepend') {
                $html = $content.$html;
            } else {
                $html = $html.$content;
            }

            $count++;
        }

        return $html;
    }
protected function _renderBlocks($name, $attribs = array())
    {
        $html   = '';
        $count  = 1;
        $blocks = $this->getBlocks($name);

        foreach($blocks as $block)
        {
            //Set the block attributes
            if($count == 1) {
                $attribs['rel']['first'] = 'first';
            }

            if($count == count($blocks)) {
                $attribs['rel']['last'] = 'last';
            }

            if(isset($block['attribs'])) {
                $block['attribs'] = array_merge((array) $block['attribs'], $attribs);
            } else {
                $block['attribs'] = $attribs;
            }

            //Render the block
            $content = $this->_renderBlock($block);

            //Prepend or append the block
            if($block['extend'] == 'prepend') {
                $html = $content.$html;
            } else {
                $html = $html.$content;
            }

            $count++;
        }

        return $html;
    }
protected function _renderBlocks ( $ name , $ attribs = array ( ) ) { $ html = '' ; $ count = 1 ; $ blocks = $ this -> getBlocks ( $ name ) ; foreach ( $ blocks as $ block ) { //Set the block attributes if ( $ count == 1 ) { $ attribs [ 'rel' ] [ 'first' ] = 'first' ; } if ( $ count == count ( $ blocks ) ) { $ attribs [ 'rel' ] [ 'last' ] = 'last' ; } if ( isset ( $ block [ 'attribs' ] ) ) { $ block [ 'attribs' ] = array_merge ( ( array ) $ block [ 'attribs' ] , $ attribs ) ; } else { $ block [ 'attribs' ] = $ attribs ; } //Render the block $ content = $ this -> _renderBlock ( $ block ) ; //Prepend or append the block if ( $ block [ 'extend' ] == 'prepend' ) { $ html = $ content . $ html ; } else { $ html = $ html . $ content ; } $ count ++ ; } return $ html ; }
Render the blocks

@param array  $name     The name of the block
@param array  $attribs  List of block attributes
@return string   The rendered block
Render the blocks