私はプラドに不慣れで、これを自分のテーブルに移す方法に問題があります。これまでのところ、これは私が行ったことです:
ホームページ:
<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();
}
}
}
?>
私はすでにデータベースとの接続を確立しています。では、データベースのアイテムをテーブルに入力するにはどうすればよいですか?