You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 .= "
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 .= "
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();
}
The text was updated successfully, but these errors were encountered: