ad esempio, ora ho il codice seguente ma mi da errore nella richiesta e non capisco perchè.
codice:
Call to undefined method Controller::loadCarsByChoice2?selection=BMW()
view:
codice:
var carModelUrl = ".../index.php/loadCarsByChoice2";
var selection = { "selection" : "BMW" };
$.getJSON(carModelUrl, selection, function(json){ ... }
controller:
codice:
function loadCarsByChoice2(){
$data = $this->model->getCarDetails();
echo $data;
}
model:
codice:
public function getCarDetails(){
$carName = $_GET["selection"];
echo " - ".$carName;
}