loadMultiple() public static method
Populates a set of models with the data from end user.
This method is mainly used to collect tabular data input. The data to be loaded for each model is $data[formName][index]
, where formName
refers to the value of formName(), and index
the index of the model in the $models
array. If formName() is empty, $data[index]
will be used to populate each model. The data being populated to each model is subject to the safety check by setAttributes().
public static boolean loadMultiple ( $models, $data, $formName = null ) | ||
---|---|---|
$models | array |
The models to be populated. Note that all models should have the same class. |
$data | array |
The data array. This is usually |
$formName | string |
The form name to be used for loading the data into the models. If not set, it will use the formName() value of the first model in |
return | boolean |
Whether at least one of the models is successfully populated. |
Please login to continue.