I am using CodeIgniter 2.2;
a while ago i created a site with codeigniter (following the codeigniter dynamic data tutorial) and made two controllers (along with their models of course) namely, suggestions and reports. And as for the first need i made the create functions for both of these controllers. However, yesterday, i tried to add the view functions and listing the values in my database too. I added the simple view functions
$data['suggestions'] = $this->suggestions_model->get_suggestions();
$this->load->view('suggestions/view',$data);
and for reports the same
$data['reports'] = $this->reports_model->get_reports();
$this->load->view('reports/view',$data);
This works fine at my local and i can see the results for both of them. However, when i put it to the production (remote) suggestions controller works with its create and view functions but reports controller doesnt return anything except the error message below
syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /my_site/application/controllers/reports.php on line 37
and line 37 is : $data['reports'] = $this->reports_model->get_reports();
and here is the first 40+ lines of the code..
<?php
class reports extends CI_Controller {
public function __construct()
{
parent::__construct();
//parent::CI_Controller();
echo "Success";
$this->load->model('reports_model');
$this->load->library("session");
$this->load->helper('url');
session_start();
echo "Başarı ile oluşturuldu";
}
public function index()
{
$data['reports'] = $this->reports_model->get_reports();
var_dump($data['reports']);
exit;
$data['title'] = 'Suggestions archive';
$this->load->view(reports/view', $data);
}
public function view()
{
$data['reports'] = $this->reports_model->get_reports();
var_dump($data['reports']);
exit;
$data['title'] = 'Suggestions archive';
$this->load->view('reports/view', $data);
}
It looks all fine, but what is the problem? And for those who ask about it, yes i load the model in constructor... Thanks in advance.
;
missing? – Jens Sep 5 '14 at 10:59{
doesn't help: show the entire method definition, or even the entire class. If you do that, I'm pretty sure the error will be easy to spot – Elias Van Ootegem Sep 5 '14 at 11:36