Welcome Guest, Not a member yet? Register   Sign In
pagination not reading config file
#17

[eluser]bigmike7801[/eluser]
[quote author="Gyzm" date="1309513277"]Hi bigmike,

Can I see your code? Post up your Pagination.php class as it is now plus how you're initializing it in your controller.[/quote]

I was unable to post the whole Pagination class due to size restrictions, so I posted what I believe was the relevant code.

Code:
/**
     * Constructor
     *
     * @access    public
     * @param    array    initialization parameters
     */
    public function __construct($params = array())
    {
        if (count($params) > 0)
        {
            $this->initialize($params);
        }


        log_message('debug', "Pagination Class Initialized");
    }

    // --------------------------------------------------------------------

    /**
     * Initialize Preferences
     *
     * @access    public
     * @param    array    initialization parameters
     * @return    void
     */
    function initialize($params = array())
    {
        if (count($params) > 0)
        {
            foreach ($params as $key => $val)
            {
                if (isset($this->$key))
                {
                    $this->$key = $val;
                }
            }
        }
        if ($this->anchor_class != '')
        {
            $this->anchor_class = 'class="'.$this->anchor_class.'" ';
        }
    }

    // --------------------------------------------------------------------

Controller

Code:
function results(){
        $this->load->library('pagination');

        $search_fields = array();

        $config['base_url'] = site_url($this->uri->uri_string());
        $config['total_rows'] = $this->jobs_m->paginate_jobs($category, $sub_category, $search_fields);
        $config['per_page'] = '3';
        $config['anchor_class'] = 'clear';
        
        $data['listings'] = $this->jobs_m->get_jobs($category, $sub_category, $search_fields, $config['per_page'], $this->uri->segment(3));
        
        $this->pagination->initialize($config);

        $this->load->view('results', $data);
    }

I'm not sure if this matters at all, but I'm using Pyrocms as well.

Thank you for your help.


Messages In This Thread
pagination not reading config file - by El Forum - 05-05-2011, 06:06 PM
pagination not reading config file - by El Forum - 05-05-2011, 07:28 PM
pagination not reading config file - by El Forum - 05-05-2011, 08:16 PM
pagination not reading config file - by El Forum - 05-05-2011, 08:36 PM
pagination not reading config file - by El Forum - 05-05-2011, 09:04 PM
pagination not reading config file - by El Forum - 05-05-2011, 09:37 PM
pagination not reading config file - by El Forum - 05-05-2011, 10:11 PM
pagination not reading config file - by El Forum - 05-05-2011, 11:31 PM
pagination not reading config file - by El Forum - 05-05-2011, 11:56 PM
pagination not reading config file - by El Forum - 05-06-2011, 12:09 AM
pagination not reading config file - by El Forum - 05-06-2011, 01:19 AM
pagination not reading config file - by El Forum - 05-25-2011, 08:35 PM
pagination not reading config file - by El Forum - 05-30-2011, 09:23 PM
pagination not reading config file - by El Forum - 06-30-2011, 06:53 PM
pagination not reading config file - by El Forum - 06-30-2011, 10:41 PM
pagination not reading config file - by El Forum - 06-30-2011, 10:50 PM
pagination not reading config file - by El Forum - 06-30-2011, 11:10 PM
pagination not reading config file - by El Forum - 06-30-2011, 11:19 PM
pagination not reading config file - by El Forum - 07-01-2011, 12:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB