Collecting tabular input

Hi everyone… :)

I don’t seem to understand these lines of code:

<?php foreach($items as $i=>$item): ?>


<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>


<?php endforeach; ?>

then from CHtml::activeTextField and CHtml::activeInputField


i believe $attribute = "[$i]name" or am i wrong with this one?

is it equivalent to:


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…

I have it too. yii 1.09

same version here…it’s weird

Guide page

is currently is not correct.

in chnange log for 1.09 no any word about it. It’s should be right for 1.1…

But it work in 1.09

Right way for tabular is:

<td><?php echo CHtml::activeTextField($model,"login[$n]"); ?></td>


<td><?php echo CHtml::activeTextField($model,"[$n]login"); ?></td>

a ok…tnx so much icevan… ;D