Hello comrades,
The problem is this: I try using the kartik select2 drop-down list to make a multiple selection of letter recipients in this way:
<?= $form->field($model, 'receiver_id')->widget(Select2::classname(), [ 'data' => ArrayHelper::map(User::find()->all(),'id','username'), 'options' => ['placeholder' => 'Select receivers...', 'multiple' => true], 'pluginOptions' => [ 'tags' => true, 'maximumInputLength' => 10 ], ]); ?> But when you click the "Send" button under the Receiver ID text box, the error "Receiver ID must be an integer" is displayed in red.
Please explain how to use this list correctly or provide alternative solutions.
Thank you in advance.
int? Maybe all the samestring? - MasterAlexforeach($model->receiver_id as $user_id) { echo $user_id.'<br />'; }foreach($model->receiver_id as $user_id) { echo $user_id.'<br />'; }. If this cycle displays the id of users who need to send a letter, then you just need to fasten the logic of sending the letter and add the rest of the repeating data from the model in this cycle. - MasterAlex