Welcome Guest, Not a member yet? Register   Sign In
Call to a member function X() on null
#1

(This post was last modified: 05-22-2020, 12:13 PM by jreklund.)

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




Theme © iAndrew 2016 - Forum software by © MyBB