我一直在尝试使用 PHP 在 Yii 的表中创建行,但不知何故我无法做到这一点。我附上了下面的代码。
PHP代码:
<div class="grid_16">
<table style="width:100%">
<tr>
<th style="width:33%;" id="wall_userNameStyle"><?php echo CHtml::activeLabel($Facility,'cname'); ?></th>
<th style="width:33%;margin:0 0.5%" id="wall_userNameStyle"><?php echo CHtml::activeLabel($Facility,'cregistration'); ?></th>
<th style="width:33%" id="wall_userNameStyle"><?php echo CHtml::activeLabel($Facility,'cannual'); ?></th>
</tr>
<?php $j=0;
for($j; $j<5; $j++)
{
?>
<tr>
<td style="width:33%;"><?php echo CHtml::activeTextField($Facility,"raymond[$j][0]",array('class' => 'edit_textbox','style' => 'width:99%')) ; ?></td>
<td style="width:33%;margin:0 0.5%"><?php echo CHtml::activeTextField($Facility,"raymond[$j][1]",array('class' => 'edit_textbox','onkeypress'=>'return number_only(event)','style' => 'width:99%')) ; ?></td>
<td style="width:33%;"><?php echo CHtml::activeTextField($Facility,"raymond[$j][2]",array('class' => 'edit_textbox','onkeypress'=>'return number_only(event)','style' => 'width:99%')) ; ?></td>
</tr>
</table>
<?php } ?>
</div>