Welcome Guest, Not a member yet? Register   Sign In
White Page Problem - very frustrating [SOLVED]
#1

[eluser]ollystretton[/eluser]
Hi I am currently working on a CI(1.6.1 on Windows 200 Platform Apache 2) application and have just created the second controller named jobs.php

When I tried to load the class it only displays a white page. The index() function is trying to load a view "job_page". The job_page.php exists as a view so I guess thats not the problem.
I have tryed echoing a "test" on to the controller which works. I have enabled error reporting and logging; this bring up no errors.

jobs.php - Controller
Code:
<?php
/*     Created 04/03/2008 by Oliver Stretton

    jobs.php - Job Controller
    --------------------------------
    Deal with all the jobs within the database.  Jobs must be approved and
    within 6 months of the posting date.  Jobs can filtered by segment:
    /jobs/                         - display all jobs
    /jobs/search/??????            - display jobs by sector
    /jobs/view/??????             - display single job (by job id)
            
    Change History
    --------------
    OS - 04/03/2008 - Page Created
*/

class Jobs extends Controller {

    function Jobs()
    {
        parent::Controller();
        ini_set('display_errors', 4);
        //Load database functions and common libararies.
        $this->load->helper('text');
        
    }
    
    function index()
    {
        
        $data['sectorMenuItems'] = $this->Common->sectorMenuItems();
        $data['mostPopularJobs'] = $this->Common->mostPopularJobs();
        
        $data['upcomingEvents'] = $this->Common->upcomingEvents();
        $this->load->view('job_page');
        
    }
    function search($division_id)
    {
        echo $division_id;
    }
    function view()
    {
        //code here
    }
}
?>

The common model is autoloaded, as is the database class.

I can't think of what could be causing the white page. Does anyone have any ideas on what I could try. Your help would be very much appreciated. I hope its nothing too obvious, thanks

Oli
#2

[eluser]ollystretton[/eluser]
DOH!!! Found the offender

function view()
{
}

Lol I knew it would something simple. Note to self: must checked reserved words in future.
#3

[eluser]Code Arachn!d[/eluser]
One thing to keep in mind if you're seeing white pages - check your php error logs you should see the error spotted in there.




Theme © iAndrew 2016 - Forum software by © MyBB