Hi everyone…
I don’t seem to understand these lines of code:
<?php foreach($items as $i=>$item): ?>
<tr>
<td><?php echo CHtml::activeTextField($item,"[$i]name"); ?></td>
<td><?php echo CHtml::activeTextField($item,"[$i]price"); ?></td>
<td><?php echo CHtml::activeTextField($item,"[$i]count"); ?></td>
<td><?php echo CHtml::activeTextArea($item,"[$i]description"); ?></td>
</tr>
<?php endforeach; ?>
then from CHtml::activeTextField and CHtml::activeInputField
$htmlOptions['value']=$model->$attribute;
i believe $attribute = "[$i]name" or am i wrong with this one?
is it equivalent to:
$item->[$i]name??
how’s the value retrieved from this construct??
when i used this method…an error was thrown…
Property "Item." is not defined.
pleas help…anyone…