Reputation: 795
I want to set up my first project in CodeIgniter. I'm following the steps as shown in this page :http://code.tutsplus.com/tutorials/everything-you-need-to-get-started-with-codeigniter--net-2634
When trying to follow the 8th step I have an error.
This is my code:
<?php
class diploma extends Controller{
function index()
{
$this->load->model('diploma_model');
$data['result'] = $this->diploma_model->
<span class="sql">getData </span>();
$data['page_title'] = "CI Hello World App!";
$this->load->view('diploma_view',$data);
}
}
?>
I'm new at CodeIgniter. Can someone explian me why this error occurs? Thanks!
After editing this piece of code
$data['result'] = $this->diploma_model->
<span class="sql">getData </span>();
$data['result'] = $this->diploma_model->
getData ();
Upvotes: 1
Views: 69
Reputation: 38672
Errors
$data['result'] = $this->diploma_model-> # Missing here
Example
$data['result'] = $this->diploma_model->getData();
FYI
This is wrong
$data['result'] = $this->diploma_model->
<span class="sql">getData </span>(); # span class cannot add to the model callback function
this should be
$data['result'] = $this->diploma_model->getData();
EDIT
This should be
class diploma extends Controller{
Change to this
class Diploma extends CI_Controller {
Upvotes: 1