I have a button with a specific parameter and I need to pass this parameter to a widget. How can I achieve this?
Specific Parameter: data-video="fbnSR-KBOiE"
The goal is to pass the parameter as 'param' => 42, like this: 'param' => fbnSR-KBOiE
Any suggestions on how to accomplish this?
echo ModalAjax::widget([
'id' => 'showVideo',
'header' => 'Create Company',
//'toggleButton' => [
// 'label' => 'New Company',
// 'class' => 'btn btn-primary pull-right'
//],
'url' => \yii\helpers\Url::toRoute(['youtube/index', **'param' => 42**]), // Ajax view with form to load
'ajaxSubmit' => true, // Submit the contained form as ajax, true by default
// ... any other yii2 bootstrap modal option you need
]);
?>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#showVideo" **data-video="fbnSR-KBOiE"** data-backdrop="false">
Show Video