CodeIgniter Forums

Full Version: White Site
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ChristopherDosin[/eluser]
I tryed to code a template controller, but i get a white site without any error.
Maybe someone can help me?

route config
Code:
$route['default_controller'] = "site";

Site.php Controller
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Site extends Controller
{
        function index()
        {
            $data['main_content'] = 'frontpage';
            $this->load->view('includes/template', $data);
        }
            
}

views/includes/template.php

Code:
<?php $this->load->view('includes/header_view'); ?>

<?php $this->load->view($main_content); ?>

<?php $this->load->view('includes/footer_view'); ?>

And of course i`ve the frontpage.php in the folder views

El Forum

[eluser]toopay[/eluser]
In CI 2.x, you should put this
Code:
class Site extends CI_Controller
instead
Code:
class Site extends Controller

El Forum

[eluser]ChristopherDosin[/eluser]
Thanks so much.

Now it`s working Smile