<head>
<meta charset="<?= Yii::$app->charset ?>"/>
<meta name="viewport" content="width=device-width; initial-scale=0.85; maximum-scale=0.85; user-scalable=0;"/>
<meta name="yandex-verification" content="......"/>
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
if ($this->cancel_flag == 0) {
$query->andFilterWhere(['not', ['address.user_id' => null]])
->andWhere(['not', ['address.project_id' => null]])
->andWhere(['not', ['address.project_template_id' => null]])
->andWhere(['address.monitor' => 1]);
}
'bootstrap' => [
'app\components\MainComponent',
],
class MainComponent extends Component
{
public $roles = ['root', 'admin']; // разрешенные роли
public function init()
{
if (Yii::$app->params['is_offline'] == 1) {
$enable_role = in_array(Yii::$app->user->identity->role, $this->roles);
$ips = explode(',', Yii::$app->params['allow_ip']);
$ips = array_map("trim", $ips);
$enable_ip = in_array($this->getIp(), $ips); //check "allowed IP"
if(!$enable_role AND !$enable_ip) {
die(Yii::$app->params['closeText']);
}
}
}
$part = TourPlayoff::find()
->where(['tour_id' => $this->tour_id, 'user_id' => [$model->user1, $model->user2]])
->asArray()
->select([new Expression('max(part) part'), new Expression('team_id')])
->all();
<tbody class="ui-sortable">
<tr data-key="7" class="ui-sortable-handle"><td style="border-top:1px solid; ">1</td><td ><img src="/upload/images/team/586246181f77b.png" alt="" style="width:35px;height:35px;"> Zenit St. Petersburg - [ robot_dqaTH ] </td></tr>
<tr data-key="1" class="ui-sortable-handle"><td >2</td><td><img src="/upload/images/team/5894d64081ada.png" alt="" style="width:35px;height:35px;"> Amkar Perm - [ akula22 ] </td></tr>
<?php
use yii\helpers\Html;
use yii\helpers\HtmlPurifier;
$this->title = Yii::$app->name . ' / ' . $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('main', 'News'), 'url' => ['/post/default/index']];
$this->params['breadcrumbs'][] = ['label' => $model->parent->title, 'url' => ['/post/default/category', 'slug' => $model->parent->slug]];
$this->params['breadcrumbs'][] = $model->title;
$this->registerMetaTag(['name' => 'description', 'content' => $model->description]);
$this->registerMetaTag(['name' => 'keywords', 'content' => $model->keywords]);
?>
<div class="col-md-6">
<div class="well">
<div class="page-title"><h1><?= Yii::t('main', 'News') ?></h1></div>
<div class="box88">
<h1 class="title"><?= Html::encode($model->title) ?></h1>
<div class="pad10">
<?= Html::img($model->picUrl, ['class' => 'img-responsive']); ?>
</div>
<div class="pad10">
<?= HtmlPurifier::process($model->short); ?>
</div>
<div class="clear"></div>
...
<div class="pad5">
<?= HtmlPurifier::process($model->full); ?>
</div>
<div class="clear"></div>
<?php if (!empty($model->tagLinks)) : ?>
<div class="tags">
<b><?= Yii::t('main', 'Tags') ?></b>:
<?= $model->tagLinks ?>
</div>
<?php endif; ?>
<div class="author_panel">
<p><i class="fa fa-user-secret"></i> <?= $model->user->username ?> <i
class="fa fa-calendar-check-o"></i> <?= Yii::$app->formatter->asDate($model->created_at) ?></p>
</div>
<br/>
<?= \app\modules\comments\widgets\CommentWidget::widget(['model' => $model]) ?>
</div>
</div>
</div>
$subQuery = (new Query())->select('id, username, text, sender_id')->from('pm')->where('user_id =2 AND sender_id !=2 AND STATUS !=2 ORDER BY created_at DESC');
$query = self::find();
$query->from(['AS tmp_table GROUP BY sender_id' => $subQuery]);
$query->with(['profile']);
<td>
<?= Html::a($item->title, 'javascript:show("newsid", ' . (int)$item->link . ')') ?>
</td>
<tr>
<td>
<div style="display:none" id="newsid_<?= (int)$item->link ?>">
<?= $item->description ?>
<?= Html::a('подробнее', ['/site/default/footballnews', 'id'=>(int)$item->link], [
'id' => 'link_fnews',
'class' => 'btn btn-small',
'data' => [
'data-method' => 'post',
],
]) ?>
</div>
</td>
<?php
$js = "$('#link_fnews').on('click', function(e)
{
e.preventDefault();
var link = $(this).attr('href');
var id = link.split('?id='); // парсю строку и получаю чистый ID новости
$('#link_fnews').html('<i class=\"fa fa-spinner fa-pulse\"></i>'); // здесь гружу анимацию(loading)
$.post
(
link,
function(data)
{
$('#link_fnews').html(''); // убираю анимацию
$('#newsid_'+id[1]).append(data) // грузим новость в блок с айди новостью
}
);
}
)";
$this->registerJs($js, $this::POS_READY);
?>