Welcome Guest, Not a member yet? Register   Sign In
Pagination Detection
#6

[eluser]Fabdrol[/eluser]
Well, there is another way but it only sees if the lib is loaded. (which means, if loaded by autoload or so, it's also present.)
Since all loaded classes are added to the main CI object ($this, in your conrollers, views, models) you could check it for presence of the pagination lib, but ONLY if you only load that lib when you need it.

try to call something like
Code:
if(isset($this->pagination))
. I'm not sure if that's the right way, since I didn't test it, and if it don't work you can always do this trick:

Code:
echo "<pre>";
var_dump($this);
echo "<pre>";

Now, you are able to to see the entire CI object, and find out wheter to use isset, empty(), or check for true or false.
Note: be careful when using that, it also dumps your entire config INCLUDING encryption keys and stuff. so... try it locally, not 'live'.


Messages In This Thread
Pagination Detection - by El Forum - 12-31-2009, 09:45 AM
Pagination Detection - by El Forum - 12-31-2009, 09:54 AM
Pagination Detection - by El Forum - 12-31-2009, 10:32 AM
Pagination Detection - by El Forum - 12-31-2009, 04:10 PM
Pagination Detection - by El Forum - 12-31-2009, 04:30 PM
Pagination Detection - by El Forum - 01-01-2010, 09:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB