0
我是新來的普拉多,我在如何將這個填充到我的表中有問題。到目前爲止,這是我做了什麼:使用Prado Framework從數據庫中填充項目
Home.page:
<com:TForm>
<com:TRepeater ID="test">
<prop:HeaderTemplate>
<table class="list" border="1px" borderWidth="1px" borderColor="#CCCCCC" style="margin-top: 30px;">
<tr>
<th>Name</th>
<th>Email</th>
</tr>
</prop:HeaderTemplate>
<prop:ItemTemplate>
<tr>
<td><%# xxxxxxxx%></> <!--this is the part where i will put my... -->
<td><%# xxxxxxxxxx%></> <!--...data from database -->
</tr>
</prop:ItemTemplate>
</com:TRepeater>
</com:TForm>
和我Home.php:
<?php
class Home extends TPage
{
protected function getListTest()
{
// Returns an array containing all the records from the table
return TestRecord::finder()->findAll();
}
public function onLoad($param)
{
if (!$this->IsPostBack)
{
// Populate the Test Drop Down from database values
$this->test->DataKeyField = 'username';
$this->test->DataKeyField = 'email';
$this->test->DataSource = $this->ListTest;
$this->test->dataBind();
}
}
}
?>
我已經建立我的數據庫連接。 那麼,我該如何填寫我的數據庫中的項目?
謝謝。這件事情的工作..我已經使用TRepeater一段時間,但後來我轉移到TDataGrid .. – lawrence