Exemple #1
0
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Создать товар', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'name', 'format' => 'html', 'value' => function ($dataProvider) {
    return Html::a($dataProvider->name, '/items/update?id=' . $dataProvider->id, ['title' => 'Редактировать']);
}], ['attribute' => 'cat_id', 'format' => 'html', 'value' => function ($dataProvider) {
    return $dataProvider->cat->name;
}], ['attribute' => 'brend_id', 'format' => 'html', 'value' => function ($dataProvider) {
    return $dataProvider->brend->name;
}], ['attribute' => 'Основное фото', 'format' => 'html', 'value' => function ($dataProvider) {
    return Items::getMainPhoto($dataProvider->id, 240, 75);
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
</div>
</div>
</div>
</div>
Exemple #2
0
                        class="glyphicon glyphicon-remove"></i></a>
            </div>
        </div>
        <div class="box-content">
            <div class="row">
                <div class="items-view">

                    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

                    <p>
                        <?php 
echo Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
                        <?php 
echo Html::a('Удалить', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
                    </p>

                    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['name', ['attribute' => 'cat_id', 'format' => 'raw', 'value' => $model->cat->name], ['attribute' => 'brend_id', 'format' => 'raw', 'value' => $model->brend->name], 'strings', 'anker', 'form', 'bridj', 'material', ['attribute' => 'pie', 'value' => $model->pie ? 'Есть' : 'Нет'], 'lad', ['attribute' => 'inlay', 'value' => $model->inlay ? 'Есть' : 'Нет'], 'shema', 'q_volume', 'q_tone', 'add', 'price', ['attribute' => 'Основное Фото', 'format' => 'html', 'value' => Items::getMainPhoto($model->id)], ['attribute' => 'Дополнительные фото', 'format' => 'html', 'value' => Photo::getPhotosHTML($model->id)]]]);
?>

                </div>
            </div>
        </div>
    </div>
</div>