Skip to content

Send parameters from button to modal-ajax #32

@vkponomarev

Description

@vkponomarev

Hello, i need to put one parameter from button to widget

data-video="fbnSR-KBOiE"

to 'param' => 42 like this 'param' => fbnSR-KBOiE

How can i do 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions