• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
configuration of any file

[eluser]Rodrigo Alexandre[/eluser]
I created a configuration file paging (in the config folder, called paging), however, when I use $ this-> config-> load (paging) settings are not carried out, that's the way it has to be done?

More like this:


But yeah..

[eluser]Rodrigo Alexandre[/eluser]
does not work that way, I've tried

post your config code and what you're trying to do

[eluser]Rodrigo Alexandre[/eluser]
$config['base_url'] = site_url('/profiles');
$config['total_rows'] = $all_reg;
$config['per_page'] = $amount_pag;

$config['full_tag_open'] = '<ul>';
$config['full_tag_close'] = '</ul>';
$config['prev_tag_open'] = '<li id="prev">';
$config['prev_tag_close'] = '</li>';
$config['next_tag_open'] = '<li id="next">';
$config['next_tag_close'] = '</li>';
$config['first_tag_open'] = '<li>';
$config['first_tag_close'] = '</li>';
$config['num_tag_open'] = '<li>';
$config['num_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li><strong>';
$config['cur_tag_close'] = '</strong></li>';

I don't think you can do pagination like that. Because you can only fetch single items when using the config class

[eluser]Rodrigo Alexandre[/eluser]
I understand, no problem, I'll create a helper

[eluser]Rodrigo Alexandre[/eluser]
I found the problem, the data must be passed as follows in the config file (pagination.php) within:

$config['full_tag_open']  = '<div id="pag"><ul>';
$config['full_tag_close'] = '</ul></div>';
$config['prev_tag_open']  = '<li id="prev">';
$config['prev_tag_close'] = '</li>';
$config['next_tag_open']  = '<li id="next">';
$config['next_tag_close'] = '</li>';
$config['first_link']     = 'Home';
$config['first_tag_open'] = '<li>';
$config['first_tag_close']= '</p> </ li>';
$config['last_link']      = 'Last page';
$config['last_tag_open']  = '<li>';
$config['last_tag_close'] = '</p> </ li>';
$config['num_tag_open']   = '<li>';
$config['num_tag_close']  = '</li>';
$config['cur_tag_open']   = '<li><strong>';
$config['cur_tag_close']  = '</strong></li>';

and the controller:

$this->load->library ('pagination');

$config['base_url']   = $url;
$config['total_rows'] = $all_reg;
$config['per_page']   = $amount_pag;

$config['num_links'] = $num_links;

Config file names must match the library you're loading if you want them to autoload from the config directory. Loading them through the Config class won't do anything except make the options available through $this->config->item() or config_item().

Your solution is the right way to do it. When you load the class, it will automatically pull a config file if it finds one. Then, you can use initialize() after that to add / override any options.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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