Guest User

Untitled

a guest
Jan 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. ...
  2. echo $form->field($phone, 'value')->widget(MultipleInput::className(), [
  3. 'max' => 6,
  4. 'min' => 1, // should be at least 2 rows
  5. 'allowEmptyList' => false,
  6. 'enableGuessTitle' => false,
  7. 'addButtonPosition' => MultipleInput::POS_HEADER
  8. ])
  9. ->label('Телефон');
  10.  
  11. ...
  12. $phone = new Phone();
  13. $data = Yii::$app->request->post();
  14.  
  15. if ($phone ->load($data)){
  16. $phone->save();
  17. var_dumb($phone);
  18. }
  19.  
  20. ...
  21. object(commonmodelsPhone)#115 (9) {
  22. ["_attributes":"yiidbBaseActiveRecord":private]=>
  23. array(2) {
  24. ["value"]=>
  25. array(3) {
  26. [0]=>
  27. string(5) "12345"
  28. [1]=>
  29. string(5) "54321"
  30. [2]=>
  31. string(4) "1357"
  32. }
  33. ...
Add Comment
Please, Sign In to add comment