I have this simple PHP code where I have created a new model with a celebrity name, a controller that accesses the celebrity name from the model, and a view to display the name. For some reason using the path below I can't display the name accessing the controller. I can't find out what I am missing or doing wrong. Thanks for the help!
Controller->
<?php
class Starcontroller extends CI_Controller{
function __construct() {parent::__construct();}
function guess()
{
$this->load->model('starmodel');
$newstarr = $this->starmodel->lookup();
$this->load->view('starview',$newstarr);
}
}
?>
Model->
<?php
class starmodel extends CI_Model{
function __construct()
{
parent::__construct();
}
public function lookup(){
$celebrity = "Anna";
return $celebrity;
}
}
?>
View ->
<html>
<head></head>
<body>
<?php
echo $newstarr;
?>
</body>
</html>