I am wanting to user pagination when a user searches for some data based on the input that they have given, however I keep on hitting the "Call to a member function ****() on a non-object" and I don't understand why. Here is my code for the pagination in my controller:
and the errors go, but then I get them for get() which I then get rid of and then finally for render(). I only went through the documentation for the ORM and it doesn't work, where am I going wrong?
There is no property "off_set", so you should have had at least a notice error. I suggest you enable all error reporting, so you see all errors.
You don't say what method call gives the error, nor the line and file that this call is on, so that leaves me with a lot of guess work.
All I can see in this snippet is: - you render the pagination in your controller, and again in your view (which is not going to work) - you run the same code and same database query twice - and you mix static usage (the find method) and method chaining, which doesn't work
It is more efficient to prep the ORM object using method chaining, and run a count() on it: