<?php $this->registerJs('(function(){
new Clipboard(\'.copy\');
})();')?>
Yii::setAlias('@frontendHost', 'http://example.com');
echo Html::img('@frontendHost/uploads/team/'. $model->image, ['width' => '150px','height' => '150px']);
[
['user_id', 'invite_id'],
'unique',
'targetAttribute' => ['user_id', 'invite_id'],
'filter' => [
'or',
['user_id' => $this->invite_id],
['invite_id' => $this->user_id],
]
],
} catch (\Exception $ex) {
throw new NotFoundHttpException('Not found');
}
url: " . Url::to(['add']) . ",
url: " . Url::to(['controllerName/add']) . ",
Yii::$app->response->format = Response::FORMAT_JSON
и тогда Yii вернет ответ в формате json. A объекту конфигурации ajax: 'dataType': 'json'
$(document).on('click', '.item img', function (event) {
var src = $(this).attr('src');
$('#foto img').attr('src', src);
});