Promo Member Baru 40%! Program Full Stack Membership! Hanya 3 Hari! Klaim Promo

Eror A PHP Error was encountered

Ditanyakan pada tanggal 12 February 2020 oleh Surya Intan Permana

Severity: Warning

Message: Use of undefined constant APPATH - assumed 'APPATH' (this will throw an Error in a future version of PHP)

Filename: core/MY_Controller.php

Line Number: 13

Backtrace:

File: C:\xampp\htdocs\ci-shop\application\core\MY_Controller.php Line: 13 Function: _error_handler

File: C:\xampp\htdocs\ci-shop\index.php Line: 318 Function: require_once

Script My_Controller

<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class MY_Controller extends CI_Controller 
{

    public function __construct()
    {
        parent::__construct();
        $model = strtolower(get_class($this));

        if (file_exists(APPATH . 'models/' . $model . '_model.php')) 
        {
            $this->load->model($model . '_model.php', $model, true);
        }    
    }

    // Memuat view dengan default layout
    public function view($data)
    {
        $this->load->view('layout/app', $data);
    }

}

Script File: C:\xampp\htdocs\ci-shop\index.php Line: 318 require_once BASEPATH.'core/CodeIgniter.php';

1 JAWABAN / 0 KOMENTAR

User avatar
Hakim Sembiring menjawab pada tanggal 12 February 2020

APPPATH bukan APPATH