private static function reversePager(NodeElement $footer, Footer $foot) { $pagerElem = $footer->find('css', 'div.dataTables_paginate'); $o = $pagerElem->getOuterHtml(); if ($pagerElem) { $pager = new Pager(); $elements = $pagerElem->findAll('css', '.paginate_button'); /** @var NodeElement $element */ foreach ($elements as $element) { $classes = explode(' ', $element->getAttribute('class')); if (!in_array('disabled', $classes, true)) { $control = new Control(); $control->setNode($element); $control->setLabel($element->getText()); if (in_array('active', $classes, true)) { $pager->addActive($control); } elseif (in_array('previous', $classes, true)) { $pager->addPrevious($control); } elseif (in_array('next', $classes, true)) { $pager->addNext($control); } else { $pager->addControl($control); } } } $foot->setPager($pager); } }
public function hasPaginate() { return null !== $this->footer->getPager(); }