CodeIgniter Forums
White Site - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: White Site (/thread-40836.html)



White Site - El Forum - 04-20-2011

[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


White Site - El Forum - 04-20-2011

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



White Site - El Forum - 04-20-2011

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

Now it`s working Smile