/** * Render a list of pages links * * @param array An optional array with configuration options * @return string Html */ public function pages($config = array()) { $config = new KConfigPaginator($config); $config->append(array('total' => 0, 'display' => 4, 'offset' => 0, 'limit' => 0, 'attribs' => array())); $html = '<ul class="pages">'; $html .= '<li class="first">« ' . $this->link($config->pages->first) . '</li>'; $html .= '<li class="previous">< ' . $this->link($config->pages->prev) . '</li>'; foreach ($config->pages->offsets as $offset) { $html .= '<li>' . $this->link($offset) . '</li>'; } $html .= '<li class="next">' . $this->link($config->pages->next) . ' ></li>'; $html .= '<li class="previous">' . $this->link($config->pages->last) . ' »</li>'; $html .= '</ul>'; return $html; }
/** * Render a list of pages links * * This function is overriddes the default behavior to render the links in the khepri template * backend style. * * @param array An optional array with configuration options * @return string Html */ public function pages($config = array()) { $config = new KConfigPaginator($config); $config->append(array('total' => 0, 'display' => 4, 'offset' => 0, 'limit' => 0, 'attribs' => array())); $class = $config->pages->first->active ? '' : 'off'; $html = '<div class="button2-right ' . $class . '"><div class="start">' . $this->link($config->pages->first) . '</div></div>'; $class = $config->pages->prev->active ? '' : 'off'; $html .= '<div class="button2-right ' . $class . '"><div class="prev">' . $this->link($config->pages->prev) . '</div></div>'; $html .= '<div class="button2-left"><div class="page">'; foreach ($config->pages->offsets as $offset) { $html .= $this->link($offset); } $html .= '</div></div>'; $class = $config->pages->next->active ? '' : 'off'; $html .= '<div class="button2-left ' . $class . '"><div class="next">' . $this->link($config->pages->next) . '</div></div>'; $class = $config->pages->last->active ? '' : 'off'; $html .= '<div class="button2-left ' . $class . '"><div class="end">' . $this->link($config->pages->last) . '</div></div>'; return $html; }