Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build pages for toHtmlSemanticUI #9

Open
thadeu opened this issue Apr 6, 2016 · 0 comments
Open

build pages for toHtmlSemanticUI #9

thadeu opened this issue Apr 6, 2016 · 0 comments

Comments

@thadeu
Copy link

thadeu commented Apr 6, 2016

Ao trabalhar com SemanticUI o retorno fica quebrado.
Então resolvi dar um extends na class e criar um método toHtmlSemanticUI e no __toString() fazer uma verificação.

/**

  • Render an HTML pagination control.
    *

  • @return string
    */
    public function toHtmlSemanticUI(){

    if ($this->paginator->getNumPages() <= 1) {
    return '';
    }

    $html = '

    ';

    if ($this->paginator->getPrevUrl()):
    $html .= '';
    endif;

    foreach ($this->paginator->getPages() as $page):
    if ($page['url']):
    $isCurrent = $page['isCurrent'] ? ' active "' : '';
    $html .= ''.$page['num'].'';
    else:
    $html .= "

    ".$page['num']."
    ";
    endif;
    endforeach;

    if($this->paginator->getNextUrl()):
    $html .= "";
    endif;

    $html .= '

    ';

    return $html;
    }

    public function __toString(){

    if($this->framework == 'SemanticUI'){
    return $this->toHtmlSemanticUI();
    }

    return $this->paginator->toHtml();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant