<?= ListView::widget([
'dataProvider' => $dataProvider,
'itemOptions' => ['tag' => false],
//'itemView' => '_teaser',
'itemView' => function ($model, $key, $index, $widget) {
return $this->render('_teaser', [
'model' => $model,
'key' => $key,
'index' => $index,
'widget' => $widget,
]);
}
]) ?>
<div class="item" data-key="<?=$model->id?>">
...
</div>
<?php if (($index+1) % 3 == 0) : ?>
я после третьего?
<?php endif; ?>
<?= ListView::widget([
'dataProvider' => $dataProvider,
'itemOptions' => ['class' => 'item'],
'itemView' => '_list_item',
'viewParams' => [
'achieves' => AchieveUser::find()
->where([
'id_user' => Yii::$app->user->identity->id,
])
->select('id_achieve')
->index('id_achieve')
->all()
],
]) ?>
<?php
if(isset($achieves[$model->id])){
echo 'Добавлено';
}
echo $model->title;
?><code >
Duolingo runs on Amazon Web Services. We use MySQL to store most of our persistent data, DynamoDB for storing user vocabularies, and a combination of Redis and memcache for caches. Most of our backend stack is written in Python, while the frontend is a combination of mustache templates, backbone.js, jQuery, and Twitter Bootstrap.