Difference between #5 and #6 of
Handling tabular data loading and validation in Yii 2

Revision #6 has been created by Kartik V on Jan 20, 2016, 7:46:10 AM with the memo:

Added Comments
« previous (#5) next (#7) »

Changes

Title unchanged

Handling tabular data loading and validation in Yii 2

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

yii, yii2, tabular, data, multiple, record, submission, validation, save

Content changed

[...]
public function actionBatchUpdate()
{
// retrieve items to be updated in a batch mode assuming each item
// is of model class 'Item'.
// Note the getItemsToUpdate method is an example method, where you
// fetch the valid models to update in your tabular form
. You need
 
    // to write such a method OR directly call your code to get the models.

$items=$this->getItemsToUpdate();
if (Model::loadMultiple($items, Yii::$app->request->post()) &&
Model::validateMultiple($items)) {
$count = 0;
foreach ($items as $item) {
[...]
3 2
51 followers
Viewed: 60 358 times
Version: 2.0
Category: Tutorials
Written by: Kartik V
Last updated by: Said Bakr
Created on: May 6, 2014
Last updated: 8 years ago
Update Article

Revisions

View all history