Контроллер:
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Soal extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->database();
}
public function index()
{
$data['judul'] = 'Halaman Ujian';
$this->load->view('templates/header_cover', $data);
$this->load->view('soal/index');
$this->load->view('templates/footer');
}
public function tampil_soal()
{
$this->load->model('soalmodel');
$this->data['tanya'] = $this->soalmodel->getPertanyaan();
$this->load->view('soal', $this->data);
}
}
Filename: soal/index.php
Line Number: 23
Backtrace:
File: C:\xampp\htdocs\TA\application\views\soal\index.php
Line: 23
Function: _error_handler
File: C:\xampp\htdocs\TA\application\controllers\Soal.php
Line: 11
Function: view
File: C:\xampp\htdocs\TA\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: soal/index.php
Line Number: 23
Backtrace:
File: C:\xampp\htdocs\TA\application\views\soal\index.php
Line: 23
Function: _error_handler
File: C:\xampp\htdocs\TA\application\controllers\Soal.php
Line: 11
Function: view
File: C:\xampp\htdocs\TA\index.php
Line: 315
Function: require_once