Yii Framework Forum: The Definitive Guide - Tabular Input - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

The Definitive Guide - Tabular Input Rate Topic: -----

#1 User is offline   brooss 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 16-November 08

Posted 27 November 2008 - 02:24 AM

In the first code example on Tabular Input in the The Definitive Guide
 if(isset($_POST['Item'][$i]))
  $item->attributes=$_POST['Item'][$i];

Should read
if(isset($_POST['Items'][$i]))
  $item->attributes=$_POST['Items'][$i];

I think.
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,900
  • Joined: 04-October 08
  • Location:DC, USA

Posted 27 November 2008 - 09:30 AM

$_POST['Item'][$i] is correct if the model class name is 'Item'.
0

#3 User is offline   brooss 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 16-November 08

Posted 30 November 2008 - 10:11 AM

Yes, i misunderstood the naming convention for the $_POST variables. I see now its explained at the bottom of the Creating Action page.

Perhaps you would consider making it a little more prominent, maybe even repeat it in the Working with Form - Overview page.

Also, a minor grammar point, shouldn't that section be named "Working with Forms" or "Working with a Form"
0

#4 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,900
  • Joined: 04-October 08
  • Location:DC, USA

Posted 30 November 2008 - 01:50 PM

Thank you! Your suggestion is taken.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users