<commit_before><?php

class ZFE_View_Helper_Paginator extends Zend_View_Helper_Abstract
{
    /**
     * The Paginator view helper
     *
     * Based on the pageInfo variable in the view, this view helper will create
     * the basic HTML structure for page links, together with the previous, next,
     * first page and last page links.
     *
     * This helper will use the pagination CSS classes as used by the Twitter
     * Bootstrap framework. Support for other frameworks may be added. Configurable
     * class names may be implemented.
     *
     * TODO Based on a function argument, this view helper will create a list of
     * page numbers, limit to show only a range around the current page number,
     * or show an input field that shows the current page number, but allows the
     * user to enter any page number.
     */
    public function paginator($options = array())
    {
        $pageInfo = $this->view->pageInfo;

        $baseUrl = $this->view->url();

        // Some handy booleans
        $firstPage = $pageInfo['page'] == 1;
        $lastPage = $pageInfo['page'] == $pageInfo['pages'];

        $html = '<ul class="pagination">';

        // If not on the first page, show the "go to first page" and the "go to
        // previous page" links.
        if (!$firstPage) {
            $html .= '<li class="first">';
            $url = $baseUrl . '?' . http_build_query(array('p' => 1));
            $html .= '<a href="' . $url . '" data-page="1">&lt;&lt;</a>';
            $html .= '</li>';<commit_msg>Support options in the paginator<commit_after><?php

class ZFE_View_Helper_Paginator extends Zend_View_Helper_Abstract
{
    /**
     * The Paginator view helper
     *
     * Based on the pageInfo variable in the view, this view helper will create
     * the basic HTML structure for page links, together with the previous, next,
     * first page and last page links.
     *
     * This helper will use the pagination CSS classes as used by the Twitter
     * Bootstrap framework. Support for other frameworks may be added. Configurable
     * class names may be implemented.
     *
     * TODO Based on a function argument, this view helper will create a list of
     * page numbers, limit to show only a range around the current page number,
     * or show an input field that shows the current page number, but allows the
     * user to enter any page number.
     */
    public function paginator($options = array())
    {
        $pageInfo = $this->view->pageInfo;

        $baseUrl = $this->view->url();

        // Some handy booleans
        $firstPage = $pageInfo['page'] == 1;
        $lastPage = $pageInfo['page'] == $pageInfo['pages'];

        $html = '<ul class="pagination"';
        foreach($options as $key => $val) $html .= " data-$key=\"$val\"";
        $html .= '>';

        // If not on the first page, show the "go to first page" and the "go to
        // previous page" links.
        if (!$firstPage) {
            $html .= '<li class="first">';
            $url = $baseUrl . '?' . http_build_query(array('p' => 1));
            $html .= '<a href="' . $url . '" data-page="1">&lt;&lt;</a>';
            $html .= '</li>';
{'fraction_non_alphanumeric': 0.12106918238993711, 'fraction_numerical': 0.0018867924528301887, 'mean_word_length': 2.3912579957356077, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '952080', 'n_tokens_mistral': 883, 'n_tokens_neox': 866, 'n_words': 350}