Welcome Guest, Not a member yet? Register   Sign In
page truns blank
#1

[eluser]Unknown[/eluser]
Hi!
My page turns blank when i write this in my controller, if i remove "parent::CI_Controller" it gives me undefined property:: $load. Does any one have a clue what might be the problem ?

Heres my controller:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class kontakt extends CI_Controller {

function kontakt()
{
parent::CI_Controller();
$this->load->helper('form');
}

function index()
{
//Titel for the page
$header['title'] = 'Kontakta';

// Load the views
$this->load->view('header', $header);
$this->load->view('view_kontakt');
$this->load->view('footer');
}
}
#2

[eluser]Beginers[/eluser]
you should have a constructor i guess? and it would be better if you put your helper to the constructor too.
every controller must have a constructor if NEEDED when you are going to load something on your controller.

add this function
Code:
function __construct()
{
   parent::__construct();
   $this->load->helper('form');
}




Theme © iAndrew 2016 - Forum software by © MyBB