【发布时间】:2010-12-11 23:42:16
【问题描述】:
我的模型中有数据进入这个控制器
function index() {
$this->load->model('work_m');
$data = array();
$config['base_url'] = base_url().'index.php/work/index/';
$config['total_rows'] = $this->db->count_all('work');
$config['per_page'] = '10';
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
$data['result'] = $this->work_m->get_records($config['per_page'],$this->uri->segment(3));
$data['title'] = 'Page Display';
$data['content'] = 'todo/work_display';
$this->load->view('template3', $data);
}
我需要在单元格中创建一个带有以下链接的表格(使用 HTML 表格类)(这是手动完成的旧方法,在我看来):
<td width="8%"><?php echo anchor("work/fill_form/$row->id", $row->id);?></td>
<td width="10%"><?php echo $row->date; ?></td>
<td width="20%"><?php echo $row->title; ?></td>
<td width="47%"><?php echo $row->item = $this->typography->auto_typography($row->item);
如何将数据转换回控制器中以便能够使用表格生成方法?使用“通常”的 php 方法会创建一个可怕的表。
【问题讨论】:
标签: php html codeigniter html-table