我是 PRADO 的新手,我有一个带有代码的文件 Home.page:
<%@ Title="Contact List" %>
<h1>Contact List</h1>
<a href="<%= $this->Service->constructUrl('insert')%>">Create New Contact</a>
<br/>
<com:TForm>
<com:TDropDownList ID="personInfo">
<com:TListItem Value="value 1" Text="item 1" />
<com:TListItem Value="value 2" Text="item 2" Selected="true" />
<com:TListItem Value="value 3" Text="item 3" />
<com:TListItem Value="value 4" Text="item 4" />
</com:TDropDownList>
</com:TForm>
& Home.php 带代码
<?php
class Home extends TPage
{
/**
* Populates the datagrid with user lists.
* This method is invoked by the framework when initializing the page
* @param mixed event parameter
*/
public function onInit($param)
{
parent::onInit($param);
// fetches all data account information
$rec = ContactRecord::finder()->findAll();
}
}
?>
$rec 包含所有值的数组。
现在我想在下拉列表中显示所有名称。我尽力了,但失败了。谁能帮我?谢谢