Welcome Guest, Not a member yet? Register   Sign In
Models causing blank pages
#1

[eluser]phused[/eluser]
I'm having an issue with my models, each time I load a model on one of my controllers the page appears blank. For example, this is one of my controllers:

Code:
<?php
class Tickets extends Controller {

    function Tickets()
    {
        parent::Controller();
        $this->load->model('Tickets_model');
    }

    function index()
    {
        $this->load->view('header');
        $this->load->view('navigation');
        $this->load->view('tickets_index');
        $this->load->view('footer');
    }
    
    function view()
    {
        $this->load->view('header');
        $this->load->view('navigation');
        $this->load->view('tickets_view');
        $this->load->view('footer');
    }

}
?>

My tickets model has the following code, fairly simple and easy:

Code:
<?php

class Tickets_model extends Model {

    function Tickets_model()
    {
        // Call the Model constructor
        parent::Model();
    }

    // Connect to database
    $this->load->database();

    function display_open_tickets
    {
        $query = $this->db->query('SELECT id, title, priority FROM tickets');
        
        foreach ($query->result_array() as $row)
        {
            echo $row['id'];
            echo $row['title'];
            echo $row['priority'];
        }
                
    }
}

?>

When I try to access /tickets page, it appears blank. However, once I remove the $this->load->model('Tickets_model'); it loads perfectly fine. I have tried to uncomment certain sections of the model to see if it was a specific part of it, but it all combinations lead to the Tickets index() page rendering blank.

Any ideas?


Messages In This Thread
Models causing blank pages - by El Forum - 09-12-2008, 07:29 PM
Models causing blank pages - by El Forum - 09-12-2008, 10:23 PM
Models causing blank pages - by El Forum - 09-13-2008, 06:03 AM
Models causing blank pages - by El Forum - 09-13-2008, 06:47 AM
Models causing blank pages - by El Forum - 09-13-2008, 07:23 AM
Models causing blank pages - by El Forum - 09-13-2008, 07:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB