I was trying a tutorial from another place to show my data from an instance object. But when i try to implement it, i found error Message: Class 'Booking' not found Filename: C:\xampp\htdocs\teja\application\controllers\controlBooking.php
this is my code in class Booking
<?php namespace application\classes;
class Booking {
protected $id;
protected $name;
protected $address;
public function setId(string $id){
$this->id = $id;
}
public function getId(){
return $this->id;
}
public function get_booking()
{
$query = $this->db->select("*")
->from('booking')
->order_by('id', 'DESC')
->get();
return $query->result();
}...
And this is my model class
<?php use application\classes\Booking;
class modelBooking extends CI_Model{
public function get_all(){
$book = new Booking();
$testimoni->get_booking();
}
}
and this is my controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class controlBooking extends CI_Controller {
public function __construct(){
parent ::__construct();
//load model
$this->load->model('modelBooking');
}
public function index(){
$data = new Booking();
$this->load->view('viewBooking', $data);
}
then how i show it in my view class? how to fix that error? thankyou for all of you, please help me to solve this