0
votes

I'm using codeigniter 2.1 and loaded pagination library in a controller. The pagination is working just fine, the only problem is,

I had to add (for pagination library in the controller that loads it)

$config['base_url'] = site_url('members/sites/'.$current_segment);

Which is fine, but it seems to override the default base_url(); to this URL in all pages under that controller. I don't want that.

I have included a sidebar navigation, and all the links there are getting changed from something like

http://www.mysite.com/about to http://www.mysite.com/members/sites/about

Which is annoying. Is there something I'm doing wrong?

I don't want add nother default URL like

$config['base_url']['one'] = "www.mysite.com"
$config['base_url']['two'] = "www.myothersite.com"

I think there should be a better way to do this. Any help is very much appreciated :) Thanks in advance

1
This $config array is for the pagination library, not the application/config/config.php right? - complex857
Yes complex. Still it seems to override the application/config/config.php base_url anyway.Strange... - tintinboss
You absolutely do not need to edit titles and mark them solved. - hjpotter92
CI has 1 config array called $config. If you have the same key in 2 files one will be overwritten unless you set the second parameter in config::load() to TRUE. If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE and each config file will be stored in an array index corresponding to the name of the config file. - None
Sorry hjpotter. I agree. Thanks - tintinboss

1 Answers

0
votes

Okay I got it :)

I was creating my links like " >All Sites

And now I think, why was it working at all??? Thats why I couldn't figure it out.. It shouldn't have worked :)

I did not echo the base_url(), so it got changed relative to the url as I just mentioned in my question (which is also weird)

However, my problem was solved by typing

" >All Sites

Thanks everyone for seeing this question Hope that helps someone...