0

我在使用 codeigniter 时遇到了困难,因为我躺在这里。我想包含在表格视图中,但是表格有问题。

这个源代码自己

$set_tabelx = array ('table_open' => "<table cellspacing='0' cellpadding='0' id='area_admin' border='1'>");
$this->table->set_template($set_tabelx);
if(isset($halaman)){
    $hal = $this->load->view('admin/'.$halaman);
}
$atas = "<div id='judul_utama'>".$judul_atas."<div class='kanan'><img src='".base_url()."images/icon_system/37.png' /> Hai, ".$this->session->userdata('username')."</div></div>";
$menu = $this->load->file("application/views/admin/menu.php", true);
$isi = "<div id='jp-container' class='jp-container'><div id='isi_admin'>".$hal."</div></div><br />";
$bawah = $this->load->file("application/views/admin/footer.php", true);

$this->table->add_row(array('data' => $atas, 'colspan' => 2));
$this->table->add_row(
    array('data' => $menu, 'valign' => "top", 'id' => "jp-menu", 'class' => "jp-menu bg_menu"),
    array( 'valign' => "top", 'class' => "bg_isi", 'data' => "<div id='jp-container' class='jp-container'><div id='isi_admin'>".$hal."</div></div><br />"));
$this->table->add_row(array('data' => $bawah, 'colspan' => 2));
echo $this->table->generate();

这个问题

if(isset($halaman)){
    $hal = $this->load->view('admin/'.$halaman);
}
$this->table->add_row(
    array('data' => $menu, 'valign' => "top", 'id' => "jp-menu", 'class' => "jp-menu bg_menu"),
    array( 'valign' => "top", 'class' => "bg_isi", 'data' => "<div id='jp-container' class='jp-container'><div id='isi_admin'>".$hal."</div></div><br />"));

任何人都可以帮助我吗?

4

1 回答 1

1

通过第三个参数将视图作为字符串返回:

$hal = $this->load->view('admin/'.$halaman, NULL, TRUE);
于 2013-02-15T23:09:32.260 回答