本文整理匯總了PHP中Dropdowns::options方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dropdowns::options方法的具體用法?PHP Dropdowns::options怎麽用?PHP Dropdowns::options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dropdowns
的用法示例。
在下文中一共展示了Dropdowns::options方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
School:
</td>
<td>
<?php
echo $profile->retrieve('school');
?>
</td>
<tr>
<tr>
<td>
Status:
</td>
<td>
<select width='200px' class='inputtextprofile' name=status>
<?php
$statusoptions = $dropdowns->options('schoolstatus');
foreach ($statusoptions as $option) {
$opid = $option['id'];
$opname = $option['name'];
echo "<option value='{$opid}'";
if ($profile->retrieve('status') == $opname) {
echo " selected";
}
echo " >{$opname}</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>
示例2: foreach
<tr>
<td>
<img src='<?php
echo $profile->retrieve("thumbnail");
?>
' align=left>
<font color=red><b><?php
echo $error;
?>
</b></font>
Send a request to <?php
echo $profile->retrieve("name");
?>
so they can confirm you are
<?php
$addas = Dropdowns::options('relationshiptype');
?>
<select name=addas>
<?php
foreach ($addas as $addasname) {
echo "<option>" . $addasname['name'] . "</option>";
}
?>
</select>
<br>
<input type=submit name=submit value="Request" class=inputsubmit>
</td>
</tr>
</table>
</form>
<?php