Utilising Pagerfanta in custom block

Permalink
Hi I want to use pagerfanta, to page a feed i'm bringing in. However i keep running into issues, can anyone advise me how to use the built in instance of pagerfanta rather than duplicate it?

so far I have the following, but I can't get it to render, i just get "Call to undefined method Pagerfanta\Pagerfanta::renderDefaultView()":

//Pagination...
        $showPagination = false;
        $podcasts = HelperDrivecast::getPodcasts(); // this is an array
        $itemsPerPage = '10';
        $paginate = true;
        if (count($podcasts) > 0) {
          $adapter = new ArrayAdapter($podcasts);
          $pagination = new Pagerfanta($adapter);
          $pages = $pagination;
            if ($pagination->getNbPages() > 1 && $paginate) {
                $showPagination = true;
                $pagination = $pagination->renderDefaultView();
                $this->set('pagination', $pagination);
            }
        } else {


Thanks in advance!

BHWW