So I got this controller Email_Controller.php, and whenever I try to call a function of it via JavaScript it just gives me this error:
- Fatal error: Class 'CI_Controller' not found in C:\wamp64\www\Projeto\application\controllers\Email_Controller.php on line <i>2</i>
My Controller looks like this:
<?php
class Email_Controller extends CI_Controller {
public function SendEmail(){
//SomeCode
}
}
any idea on whats going on? My Main Controller is just working fine...
this is my JS
function teste() {
var email = document.getElementById("email").value;
var name = document.getElementById("name").value;
jQuery.ajax({
type: "POST",
url: 'application/controllers/Main_Controller.php/SendEmail',
data: {Post_email: email, Post_name: name},
success: function (response) {
console.log("success");
console.log(response);
},
error: function(response){
console.log("error");
console.log(response);
}
});
}
My routes.php
$route['default_controller'] = 'Main_Controller';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;