Html::a($news->title, ['news/view', '' => $news->url])
Html::a($news->title, ['news/', '' => $news->url])
<div class="col-md-7 contact-form">
<?php $form = ActiveForm::begin() ?>
<?= $form->field($model, 'name', ['template' => "{label}\n{input}"])->label(false)
->textInput([
'placeholder' => "Name",
'class' => "",
'id' => "nameContact",
]) ?>
<?= $form->field($model, 'email', ['template' => "{label}\n{input}"])->label(false)
->textInput([
'placeholder' => "Email",
'class' => "",
'id' => "emailContact",
]) ?>
<?= $form->field($model, 'subject')
->textarea([
'rows' => 2,
'cols' => 5,
'placeholder' => "Your message",
'class' => "",
'id' => "messContact",
])->label(false); ?>
<?=Html::submitInput('Send', ['class' => '', 'id' => 'sendBut']);?>
<?php $form = ActiveForm::end() ?>
<div id="info-send" class="alert alert-success"></div>
<div id="error-send" class="alert alert-danger"></div>
<div id="info-send" class="alert alert-success"></div>
<div id="error-send" class="alert alert-danger"></div>
</div>
if(\Yii::$app->request->isAjax){
print_r(Yii::$app->request->post());
$name = Yii::$app->request->post('name');
return "Спасибо, ваше сообщение принято. {$name}";
} else {
return $this->render('statPages/stat-ru', compact('model'));
}
$script = <<<JS
$('form').on('beforeSubmit', function(){
console.log("qw");
var data = $(this).serialize();
$.ajax({
url: '/',
type: 'POST',
data: data,
success: function(res){
console.log(res);
$('#info-send').html(res);
$('#info-send').css('display','block');
},
error: function(){
$('#error-send').html('Ошибка при отправке сообщения. Перезагрузите страницу');
$('#error-send').css('display','block');
}
});
return false;
});
JS;
$this->registerJs($script, yii\web\View::POS_READY);
SELECT *
FROM `movie` AS `f`
JOIN `movie_genre` AS `fj1` ON `fj1`.`movie_id` = `f`.`id`
AND `fj1`.`genre_id` IN (SELECT `id` FROM `genre` WHERE `name` = 'Ужасы')
LEFT JOIN `movie_genre` AS `fj2` ON `fj2`.`movie_id` = `f`.`id`
AND `fj2`.`genre_id` IN (SELECT `id` FROM `genre` WHERE `name` = 'Комедия')
WHERE `fj2`.`movie_id` IS NULL
SELECT M.*
FROM movie M
JOIN movie_genre A ON M.id = A.movie_id
JOIN movie_genre B ON M.id = B.movie_id
WHERE A.genre_id=1 AND B.genre_id=2
SELECT M.*
FROM movie M
JOIN movie_genre A ON M.id = A.movie_id
JOIN movie_genre B ON M.id = B.movie_id
WHERE A.genre_id=1 AND B.genre_id<>2
Попытки найти confirmation_url (как в оффДокументации) провалились. Оказывается этот параметр переименовали в confirmationUrl.
Надо быть внимательнее =)
Спасибо!