【发布时间】:2013-01-08 01:06:46
【问题描述】:
我只需要它的最后 2 条记录。 下面的代码返回所有记录。谢谢
<?php
foreach ($fields as $field) {
$type = $field['s_type'];
$label = $field['s_label'];
$value = Attributes::newInstance()->getValue($item_id, $field['pk_i_id']);
if ($type == 'checkbox') {
if ($value == 'checked') $value = 'Yes';
else $value = 'No';
}
?>
<tr>
<td style='width: 150px;'><?php _e($label, pg); ?></td>
<td style='width: 150px;'><?php _e($value, pg); ?></td>
</tr>
<?php } ?>
【问题讨论】:
-
抱歉 $fileds 来自如下函数 $fields = Attributes::newInstance()->getFields();