Answer the question
In order to leave comments, you need to log in
Yii2. How to force \yii\bootstrap\Modal to send form request?
$menuItems[] = \yii\bootstrap\Modal::widget([
'id' => 'auth-modal',
'toggleButton' => [
'label' => \Yii::t('app/auth','login'),
'tag' => 'a',
'data-target' => '#auth-modal',
'href' => Url::toRoute(['/site/login']),
'class' => 'headerLogin'
],
'clientOptions' => false
]);
Answer the question
In order to leave comments, you need to log in
solved by forced loading
in view:
\yii\bootstrap\Modal::widget([
'id' => 'auth-modal',
'toggleButton' => [
...
'class' => 'header-link-login'
.....
$('a.header-link-login').on('click', function(){
var form = $('#auth-modal .modal-content');
$.post(base_url + '/site/login')
.done(function(result) {
form.empty().append(result);
})
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question