first commit
This commit is contained in:
41
backend/modules/banner/views/banner/_form.php
Executable file
41
backend/modules/banner/views/banner/_form.php
Executable file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use kartik\widgets\FileInput;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var common\models\Banner $model */
|
||||
/** @var yii\widgets\ActiveForm $form */
|
||||
?>
|
||||
|
||||
<div class="banner-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'photo')->widget(FileInput::class, [
|
||||
'pluginOptions' => [
|
||||
'showZoom' => false,
|
||||
'initialPreview' => [
|
||||
$model->photo != null ? Html::img('@web/images/banner/' . $model->photo, ['class' => 'file-preview-image']) : null,
|
||||
],
|
||||
'overwriteInitial' => true,
|
||||
'showCaption' => false,
|
||||
'showUpload' => false,
|
||||
'showRemove' => true,
|
||||
'showDetails' => true,
|
||||
'browseClass' => 'btn btn-primary btn-block',
|
||||
'browseIcon' => '<i class="fa fa-camera"></i> ',
|
||||
'browseLabel' => 'Выберите фото',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= $form->field($model, 'rating')->textInput() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
20
backend/modules/banner/views/banner/create.php
Executable file
20
backend/modules/banner/views/banner/create.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var common\models\Banner $model */
|
||||
|
||||
$this->title = 'Create Banner';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Banners', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="banner-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
42
backend/modules/banner/views/banner/index.php
Executable file
42
backend/modules/banner/views/banner/index.php
Executable file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use common\models\Banner;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\grid\ActionColumn;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var yii\data\ActiveDataProvider $dataProvider */
|
||||
|
||||
$this->title = 'Banners';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="banner-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Create Banner', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id',
|
||||
'photo',
|
||||
'rating',
|
||||
[
|
||||
'class' => ActionColumn::className(),
|
||||
'urlCreator' => function ($action, Banner $model, $key, $index, $column) {
|
||||
return Url::toRoute([$action, 'id' => $model->id]);
|
||||
}
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
</div>
|
21
backend/modules/banner/views/banner/update.php
Executable file
21
backend/modules/banner/views/banner/update.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var common\models\Banner $model */
|
||||
|
||||
$this->title = 'Update Banner: ' . $model->id;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Banners', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="banner-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
38
backend/modules/banner/views/banner/view.php
Executable file
38
backend/modules/banner/views/banner/view.php
Executable file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var common\models\Banner $model */
|
||||
|
||||
$this->title = $model->id;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Banners', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="banner-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'photo',
|
||||
'rating',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
12
backend/modules/banner/views/default/index.php
Executable file
12
backend/modules/banner/views/default/index.php
Executable file
@ -0,0 +1,12 @@
|
||||
<div class="banner-default-index">
|
||||
<h1><?= $this->context->action->uniqueId ?></h1>
|
||||
<p>
|
||||
This is the view content for action "<?= $this->context->action->id ?>".
|
||||
The action belongs to the controller "<?= get_class($this->context) ?>"
|
||||
in the "<?= $this->context->module->id ?>" module.
|
||||
</p>
|
||||
<p>
|
||||
You may customize this page by editing the following file:<br>
|
||||
<code><?= __FILE__ ?></code>
|
||||
</p>
|
||||
</div>
|
Reference in New Issue
Block a user