Welcome Guest, Not a member yet? Register   Sign In
Pagination inquiry for this n00b!

Yay, I'm officially labeling myself a n00b. :-)

I appreciate the time anyone who enters a thread with 'paginatin' in the topic as well. :-)

Either way, here it is plain and simple. My controller's constructor looks like this:

function inventory()
        $this->load->model('Autodb_model', 'autodb');

and within the controller, is my method for displaying an inventory:

function client_side()
        // client side inventory view.
        // This is VERY similar to the live() method
        // which retrieves the data we need for current
        // live vehicles. Let's grab this data.
        $data['opts'] = $this->autodb->get_vehicle_options();
        // config params for pagination
        $config['base_url'] = 'http://'.base_url().'/inventory/client_side';
        $config['total_rows'] = count($data['opts']);
        $config['per_page'] = '10';
        $config['uri_segment'] = 2;
        $this->load->view('client/inventory_view', $data);


Then within my view I execute the following code:


                &lt;!--<h5><a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">Next</a> <a href="#">>></a></h5>--&gt;
                &lt;?= $this->pagination->create_links() ?&gt;

Any idea why the pagination class isn't properly being loaded?

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Inventory::$pagination

Filename: controllers/inventory.php

Line Number: 67

Thanks for looking, folks!

- sf

Well, it works fine when I put:


into the method, not sure why I can't use $this->load->library('session','pagination'); in the constructor. Would love to learn if anyone feels like schooling me. :-)

[eluser]Michael Wales[/eluser]
The library method of the Loader class accepts parameters as the second parameter. Therefore this line:
Is loading the session library and passing it a parameter of pagination.

You got your helper() and library() methods a bit confused - it happens to me all the time.

Thanks Michael! How're ya doing btw? Just finishing up http://www.f1autoimports.com before I submit it as my first completed CI project. (few things on the CSS side I need to fix up) but I'm almost there.

Got pagination working btw, thank you greatly to also CodeOfficer on IRC. :-)


Still haven't started my next project. I'm still contemplating between CI/EE or ZenCart for my shopping cart... aaaaah!!! The decision is KILLING ME! I so want to stay with this community, :-( Just hard to avoid a product that caters to a cart specifically...

[eluser]Michael Wales[/eluser]
Check out EE's addons/plugins - I'm sure there is a cart module available.

I've been thinking of switching to EE Core for my blog... just to learn my way around the system as I am considering using EE for a future project of mine.

yes, you meant this:

Theme © iAndrew 2016 - Forum software by © MyBB