/** * Render the object into a string. * * @return mixed */ public function render() { if ($this->paginator->hasPages()) { return new Node('nav', ['class' => 'text-xs-center'], [new UnorderedList(['class' => 'pagination'], $this->getLinks())]); } return new Node('nav', [], []); }
/** * Determine if the underlying paginator being presented has pages to show. * * @return bool */ public function hasPages() { return $this->paginator->hasPages(); }
/** * 是否需要分页 * * @return bool */ public function hasPages() { return $this->paginator->hasPages() && count($this->paginator->items()) > 0; }
/** * Render the object into a string. * * @return mixed */ public function render() { return Std::firstBias($this->paginator->hasPages(), function () { return new CardBlock(['class' => 'card-block text-center'], new BootstrapFourPaginatorPresenter($this->paginator)); }, ''); }