試圖弄清楚如何正確執行此操作。從HTML表格類創建表格
的print_r的是這樣的:
Array ([0] => stdClass Object ([quote] => "Now that's wonderful!"))
創建表:
$tmpl = array ('table_open' => '<table class="table" id="quotes-table">');
$this->table->set_template($tmpl);
print_r($quotes);
$data = array(
array(form_checkbox('quotes'), 'Quote'),
array(form_checkbox('quotes'), 'Testing Quote Here'),
array(form_checkbox('quotes'), $quotes['quote'])
);
echo $this->table->generate($data);
?>
UPDATE:
問題,但我比1行添加更多的T它只返回一個行。所以基本上我想要一個可以從查詢返回的對象,以便在視圖中我可以簡單地執行$ quote-> quote。這樣它將顯示用戶的所有報價。
<?php
$tmpl = array ('table_open' => '<table class="table" id="quotes-table">');
$this->table->set_template($tmpl);
$checkbox_data = array(
'name' => 'quote',
'id' => $quotes->id
);
$data = array(
array(form_checkbox($checkbox_data), 'Quote'),
array(form_checkbox($checkbox_data), $quotes->quote)
);
echo $this->table->generate($data);
什麼你有問題嗎?錯誤? – animuson
未定義的指數:沒有意義的報價 –