MY_Pagination and config file.

#1
[eluser]jedre[/eluser]
Hello.

I have pagination config file (config/pagination.php).
When I extending pagination library (library/MY_Pagination.php), settings in pagination config file doesn't work.

Why?

#2
[eluser]Tom Glover[/eluser]
Have you called a CI instance in your library to use the config files:
Code:
$CI =& get_instance();

Then you call your config file like so:
Code:
$CI->config->load('filename');

Just replace
Code:
$this
with
Code:
$CI
to use any CI function in your library.

#3
[eluser]jedre[/eluser]
I resolved this problem by another way, in MY_Pagination constructor i set values ex:

Code:
$this->full_tag_open = '<p style="text-align:center;">';
$this->first_link = '&laquo; pierwsza';
$this->last_link = 'ostatnia &raquo;';

However when I don't extend pagination library, I mustn't load pagination.php config file.
This settings was load automatically and I don't set it in autoload.php file, and don't use load method.

#4
[eluser]Glen Swinfield[/eluser]
have you put a constructor in your exesion, but not called the parent constructor?

parent:Tongueagination();

#5
[eluser]jedre[/eluser]
yep, I have:

Code:
parent::CI_Pagination();

From user guide
Quote:Note: If you need to use a constructor in your class make sure you extend the parent constructor:
class MY_Input extends CI_Input {

function My_Input()
{
parent::CI_Input();
}
}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.