TbHtml::paginationLink PHP Method

    public static function paginationLink($label, $url, $htmlOptions = array())
    {
        $linkOptions = TbArray::popValue('linkOptions', $htmlOptions, array());
        if (TbArray::popValue('active', $htmlOptions, false)) {
            self::addCssClass('active', $htmlOptions);
            $label .= ' ' . self::tag('span', array('class' => 'sr-only'), '(current)');
        }
        if (TbArray::popValue('disabled', $htmlOptions, false)) {
            self::addCssClass('disabled', $htmlOptions);
        }
        $content = self::link($label, $url, $linkOptions);
        return self::tag('li', $htmlOptions, $content);
    }

Usage Example

Exemplo n.º 1
0
 public function testPaginationLink()
 {
     $I = $this->codeGuy;
     $html = TbHtml::paginationLink('Link', '#', array('class' => 'item', 'linkOptions' => array('class' => 'link')));
     $li = $I->createNode($html, 'li');
     $I->seeNodeCssClass($li, 'item');
     $a = $li->filter('a');
     $I->seeNodeCssClass($a, 'link');
     $I->seeNodeAttribute($a, 'href', '#');
 }
TbHtml