• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call to a member function X() on null

#1
I am using CI 3.0.4 HMVC that supports 3.x CI The ERROR i got: 
An uncaught Exception was encountered
Type: Error
Message: Call to a member function display_games() on null
Filename: C:\xampp\htdocs\pda-projekt_GERGEL\application\modules\Admin\controllers\Admin.php
Line Number: 18
Backtrace:
File: C:\xampp\htdocs\pda-projekt_GERGEL\index.php
Line: 292
Function: require_once


Admin.php:

Code:
<?php

class Admin extends MY_Controller
{
function __construct()
{
parent::__construct();
$this->load->module('Games');
}

function index()
{
$this->template->call_admin_template();
}

function games()
{
$this->games->display_games(); //LINE 18
}
}

THIS IS Games/Controller/Games.php where i call display_games function:

Code:
<?php

class Games extends MY_Controller
{
     function __construct()
    {
        parent::__consturct();
    }

    function display_games()
    {
        $this->template->call_admin_template();
    }
}
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.