Welcome Guest, Not a member yet? Register   Sign In
White Site
#1

[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
#2

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

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

Now it`s working Smile




Theme © iAndrew 2016 - Forum software by © MyBB