team.php 2.13 KB
<?php
    /**
     * @var User               $company
     * @var ActiveDataProvider $team
     * @var View               $this
     * @var ActiveDataProvider $comments
     */
    use common\models\User;
    use yii\data\ActiveDataProvider;
    use yii\helpers\Html;
    use yii\web\View;
    use yii\widgets\LinkPager;
    use yii\widgets\ListView;

    $this->params[ 'company' ] = $company;
    $this->title = 'My Yii Application';
?>
    <div class="command-blocks-wr style">
        <?= ListView::widget([
            'dataProvider' => $team,
            'itemView'     => '_company_list_view',
            'layout'       => '{items}',
        ]); ?>


    </div>
    <div class="navi-buttons-wr style command-command-style">
        <?= LinkPager::widget([
            'pagination' => $team->pagination,
        ]); ?>
    </div>
<?php
    /*====Blocks for layout====*/
    if($comments->totalCount > 0) {
        $this->beginBlock('review');
        ?>
        <div class="section-box-19">
            <div class="box-wr">
                <div class="box-all">
                    <div class="company-performer-comm-title style">Отзывов: <?= $comments->totalCount ?></div>
                    <?= ListView::widget([
                        'dataProvider' => $comments,
                        'itemView'     => '_company_team_review',
                        'layout'       => '{items}',
                        'options'      => [
                            'class' => 'company-performer-comments-wr style',
                        ],
                        'itemOptions'  => [
                            'class' => 'company-performer-comments-bl',
                        ],
                    ]) ?>
                    <div class="company-performer-comm-see-all-butt style">
                        <?= Html::a('Читать все отзывы', [
                            'company/review',
                            'company_id' => $company->id,
                        ]) ?>
                    </div>
                </div>
            </div>
        </div>
        <?php
        $this->endBlock();
    }
    /*====End blocks for layout====*/
?>