What Is The Meaning Of The $This->Getitemstoupdate()

while i am using $this->getItemsToUpdate() while collecting the tabular input but i am getting the error that there is no such method wheather the getItemToUpdate() method to be implemented by us or not

here is my code

view

<div class="row">

	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'name'); ?&gt;


	&lt;?php echo &#036;form-&gt;textField(&#036;model,'name'); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'name'); ?&gt;


&lt;/div&gt;





&lt;div class=&quot;row&quot;&gt;


	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'surname'); ?&gt;


	&lt;?php echo &#036;form-&gt;textField(&#036;model,'surname'); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'surname'); ?&gt;


&lt;/div&gt;





&lt;div class=&quot;row&quot;&gt;


	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'email'); ?&gt;


	&lt;?php echo &#036;form-&gt;textField(&#036;model,'email'); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'email'); ?&gt;


&lt;/div&gt;

<div class="row">

&lt;?php &#036;items = array(1,2); ?&gt;


&lt;?php foreach (&#036;items as &#036;i=&gt;&#036;item): ?&gt;


&lt;?php echo &#036;form-&gt;textField(&#036;modelAddress, '[&#036;i]street'); ?&gt;


&lt;?php echo &#036;form-&gt;textField(&#036;modelAddress, '[&#036;i]city'); ?&gt;


&lt;?php echo &#036;form-&gt;textField(&#036;modelAddress, '[&#036;i]state'); ?&gt;


&lt;?php endforeach; ?&gt;

</div>

then i should collected the data of the modelAddress field in controller

controller

public function actionBatchUpdate()

{


	&#036;model = new User;


	&#036;modelAddress = new Address;


	&#036;items=&#036;this-&gt;getItemsToUpdate();


if(isset(&#036;_POST['Item']))


{


    


    foreach(&#036;items as &#036;i=&gt;&#036;item)


    {


        if(isset(&#036;_POST['Address'][&#036;i]))


            &#036;item-&gt;attributes=&#036;_POST['Address'][&#036;i];


        &#036;valid=&#036;item-&gt;validate() &amp;&amp; &#036;valid;


    }


    if(&#036;valid)  // all items are valid


        // ...do something here


}


	


	&#036;this-&gt;render('batchUpdate', array(


	'model' =&gt; &#036;model,


	'modelAddress' =&gt; &#036;modelAddress,


	));


}

please help me

It’s just a placeholder. You need to use your own code to get the relevant models.

please give me the sample code

give me a simple code snippet for this…plz

@SUBHASH, softies

note that foreach loops through an array, so the sample could be anything like:


$items = [0,1,2,3,4]

if you want 5 rows of totally new items

or


$items = Item::model()->findAll(array('index'=>'iditem');

if you want all the current records in the table