lundi 14 mars 2016

Laravel Custom Presenter / Pagination Class 'Illuminate\Pagination\Presenter' not found

Hey guys I am creating a custom Laravel 5 pagination presenter using http://ift.tt/22e8ruj as a guide, I have followed the instruction but my App is having problem finding the Illuminate\Pagination\Presenter class ( which i am extending from ).

I am calling the presenter in my view

view

 <div class="cf">
    <div class="columns large-6 text-left paginate">

    <?php 
        $presenter = new App\Pagination\Presenters\customPresenter($paginator);

....

There error that i am receiving is

FatalErrorException in customPresenter.php line 7:
Class 'Illuminate\Pagination\Presenter' not found

My CustomPresenter class looks like;

<?php 

namespace App\Pagination\Presenters;

use Illuminate\Pagination\Presenter;

class customPresenter extends Presenter { << error occurs here

/**
 * Get the previous page pagination element.
 *
 * @param  string  $text
 * @return string
 */
public function getPrevious($text = '<i class="fa fa-angle-left"></i>')
{
    // If the current page is less than or equal to one, it means we can't go any
    // further back in the pages, so we will render a disabled previous button
    // when that is the case. Otherwise, we will give it an active "status".
    if ($this->currentPage <= 1)
    {
        return $this->getDisabledTextWrapper($text);
    }

....

Am I missing a package? I have done a composer update and added my customPresenter class to the autoload.

Any help greatly appreciated

cheers



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire