protected function _renderRepeatedDisplayView($options, $repeaterRows = [])
    {
        $repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);
        // $repeaterRows[0] check allows skipping of block check (used for dummy data)
        if (($repeaterRows && $repeaterBlocks) || (isset($repeaterRows[0]) && $repeaterRows[0] === 0)) {

            // pagination
            if (!empty($options['per_page'])) {
                $pagination = new LengthAwarePaginator($repeaterRows, count($repeaterRows), $options['per_page'], Request::input('page', 1));
                $pagination->setPath(Request::getPathInfo());
                $paginationLinks = PaginatorRender::run($pagination);
                $repeaterRows = array_slice($repeaterRows, (($pagination->currentPage() - 1) * $options['per_page']), $options['per_page'], true);
            } else {
                $paginationLinks = '';
            }
            $options['pagination'] = $paginationLinks;
            $options['links'] = $paginationLinks;
            $options['blocks'] = $repeaterBlocks;
            return parent::_renderRepeatedDisplayView($options, $repeaterRows);
        }
        return '';
    }
protected function _renderRepeatedDisplayView($options, $repeaterRows = [])
    {
        $repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);
        // $repeaterRows[0] check allows skipping of block check (used for dummy data)
        if (($repeaterRows && $repeaterBlocks) || (isset($repeaterRows[0]) && $repeaterRows[0] === 0)) {

            // pagination
            if (!empty($options['per_page'])) {
                $pagination = new LengthAwarePaginator($repeaterRows, count($repeaterRows), $options['per_page'], Request::input('page', 1));
                $pagination->setPath(Request::getPathInfo());
                $paginationLinks = PaginatorRender::run($pagination);
                $repeaterRows = array_slice($repeaterRows, (($pagination->currentPage() - 1) * $options['per_page']), $options['per_page'], true);
            } else {
                $paginationLinks = '';
            }
            $options['pagination'] = $paginationLinks;
            $options['links'] = $paginationLinks;
            $options['blocks'] = $repeaterBlocks;
            return parent::_renderRepeatedDisplayView($options, $repeaterRows);
        }
        return '';
    }
protected function _renderRepeatedDisplayView ( $ options , $ repeaterRows = [ ] ) { $ repeaterBlocks = BlockRepeater :: getRepeaterBlocks ( $ this -> _block -> id ) ; // $repeaterRows[0] check allows skipping of block check (used for dummy data)
 if ( ( $ repeaterRows && $ repeaterBlocks ) || ( isset ( $ repeaterRows [ 0 ] ) && $ repeaterRows [ 0 ] === 0 ) ) { // pagination
 if ( ! empty ( $ options [ 'per_page' ] ) ) { $ pagination = new LengthAwarePaginator ( $ repeaterRows , count ( $ repeaterRows ) , $ options [ 'per_page' ] , Request :: input ( 'page' , 1 ) ) ; $ pagination -> setPath ( Request :: getPathInfo ( ) ) ; $ paginationLinks = PaginatorRender :: run ( $ pagination ) ; $ repeaterRows = array_slice ( $ repeaterRows , ( ( $ pagination -> currentPage ( ) - 1 ) * $ options [ 'per_page' ] ) , $ options [ 'per_page' ] , true ) ; } else { $ paginationLinks = '' ; } $ options [ 'pagination' ] = $ paginationLinks ; $ options [ 'links' ] = $ paginationLinks ; $ options [ 'blocks' ] = $ repeaterBlocks ; return parent :: _renderRepeatedDisplayView ( $ options , $ repeaterRows ) ; } return '' ; }
Check per page values and load block info to pass to repeated view
@param array $options
@param array $repeaterRows
@return string
Check per page values and load block info to pass to repeated view