Hi,
I did everything as show in this video: https://www.youtube.com/watch?v=aUAUsADp9ao
And when I am using a button it works fine.
But I need to use a link (a href) and this is my code:
<?= Html::a(Html::tag('div', '', ['class'=> ['opt', 'opt_1']]), ['site/login'], ['id'=>'notlogin']); ?>
javascript (I changed “value” to “href” and it still doesn’t work):
$(function(){
$('#notlogin').click(function (){
$('#modal').modal('show')
.find('#notloginContent')
.load($(this).attr('href'));
});
});
<?php
Modal::begin([
'header' => '<h4>Not logged</h4>',
'id' => 'modal',
'size' => 'modal-md',
]);
echo '<div id="notloginContent"></div>';
Modal::end();
?>