Welcome Guest, Not a member yet? Register   Sign In
Strange problem with $this->load->view
#13

[eluser]coolfactor[/eluser]
First off, the function itself should be written without making any assumptions about custom routes.

That means this line:
Code:
$sec_id = (int)$this->uri->segment(2);

...should be changed to:
Code:
$sec_id = (int)$this->uri->rsegment(3); // rewritten-segment

...or get the parameters from the function arguments:
Code:
function index($sec_id = 0, $start = 0) {

Both ways will isolate the custom routing from the function definition.

---

I suspect the problem is happening with this redirect:
Code:
if (!$data['articles']) redirect('');

Try adding this code before that line to see exactly what is in the $data array:
Code:
var_dump($data);
exit();

You might find that $data['articles'] is evaluating to FALSE for some reason.


Messages In This Thread
Strange problem with $this->load->view - by El Forum - 11-27-2007, 02:54 AM
Strange problem with $this->load->view - by El Forum - 11-27-2007, 03:30 AM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 12:03 AM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 01:44 AM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 02:17 AM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 05:15 AM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 08:47 AM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 10:39 AM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 11:55 AM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 09:32 PM
Strange problem with $this->load->view - by El Forum - 11-28-2007, 09:39 PM
Strange problem with $this->load->view - by El Forum - 11-29-2007, 02:41 AM
Strange problem with $this->load->view - by El Forum - 11-29-2007, 03:09 AM
Strange problem with $this->load->view - by El Forum - 11-29-2007, 03:45 AM
Strange problem with $this->load->view - by El Forum - 01-31-2008, 09:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB