Welcome Guest, Not a member yet? Register   Sign In
Can't get segment() info
#2

[eluser]Twisted1919[/eluser]
1. Don't load the uri class, it is auto loaded by CI .
2. $this->uri->segment(0) doesn't exists, the count starts from 1.
3. print_r($this->uri->segment_array()) gives you ?
4. don't do database calls from your controller, move them in your models, and call the models .
5. don't foreach($rs_users->result() as user) in your view. Instead, in your controller do
$data['users'] = $this->model_name->get_users(); and in your view foreach($users AS $user);
6. don't $this->load->helper(1),$this->load->helper(2) blah . $this->load->helper(array(1,2,3,n)); is the way .
7.You will use your database in all your controllers instances maybe, so autoload it , don't load it in the constructor .


Messages In This Thread
Can't get segment() info - by El Forum - 07-24-2010, 09:31 AM
Can't get segment() info - by El Forum - 07-24-2010, 09:47 AM
Can't get segment() info - by El Forum - 07-24-2010, 09:58 AM
Can't get segment() info - by El Forum - 07-24-2010, 10:01 AM
Can't get segment() info - by El Forum - 07-24-2010, 10:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB