|
这是错误信息:A PHP Error was encountered
Severity: 4096
Message: Object of class stdClass could not be converted to string
Filename: libraries/Table.php
Line Number: 269
代码:
控制器
function listing()
{
$this->load->library('table');
$this->load->model('blogmodel','',TRUE);
$students_qry = $this->blogmodel->listStudents();
// generate HTML table from query results
$students_table = $this->table->generate($students_qry);
// display information for the view
$data['title'] = "Classroom: Student Listing";
$data['headline'] = "Student Listing";
$data['include'] = 'student_listing';
$data['data_table'] = $students_table;
$this->load->view('blog_view', $data);
}
模型:function listStudents() {
$query=$this->db->get('demo');
return $query->result();
}
视图:<?php echo $data_table; ?> |
|