first commit
This commit is contained in:
12
backend/modules/news/views/default/index.php
Executable file
12
backend/modules/news/views/default/index.php
Executable file
@ -0,0 +1,12 @@
|
||||
<div class="news-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>
|
31
backend/modules/news/views/news/_form.php
Executable file
31
backend/modules/news/views/news/_form.php
Executable file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var common\models\News[] $model */
|
||||
/** @var yii\widgets\ActiveForm $form */
|
||||
?>
|
||||
|
||||
<div class="news-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
|
||||
|
||||
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'text')->widget(\asmoday74\ckeditor5\EditorClassic::class, [
|
||||
'clientOptions' => [
|
||||
'language' => 'en',
|
||||
]
|
||||
]) ?>
|
||||
|
||||
<?= $form->field($model, 'slug')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
33
backend/modules/news/views/news/_search.php
Executable file
33
backend/modules/news/views/news/_search.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var app\modules\news\models\NewsSearch $model */
|
||||
/** @var yii\widgets\ActiveForm $form */
|
||||
?>
|
||||
|
||||
<div class="news-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'title') ?>
|
||||
|
||||
<?= $form->field($model, 'text') ?>
|
||||
|
||||
<?= $form->field($model, 'slug') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-outline-secondary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
20
backend/modules/news/views/news/create.php
Executable file
20
backend/modules/news/views/news/create.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var common\models\News $model */
|
||||
|
||||
$this->title = 'Create News';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'News', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="news-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
46
backend/modules/news/views/news/index.php
Executable file
46
backend/modules/news/views/news/index.php
Executable file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use common\models\News;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use yii\grid\ActionColumn;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var app\modules\news\models\NewsSearch $searchModel */
|
||||
/** @var yii\data\ActiveDataProvider $dataProvider */
|
||||
|
||||
$this->title = 'News';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="news-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Create News', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id',
|
||||
'title',
|
||||
'text:ntext',
|
||||
'slug',
|
||||
[
|
||||
'class' => ActionColumn::className(),
|
||||
'urlCreator' => function ($action, News $model, $key, $index, $column) {
|
||||
return Url::toRoute([$action, 'id' => $model->id]);
|
||||
}
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
</div>
|
21
backend/modules/news/views/news/update.php
Executable file
21
backend/modules/news/views/news/update.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var common\models\News $model */
|
||||
|
||||
$this->title = 'Update News: ' . $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'News', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="news-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
39
backend/modules/news/views/news/view.php
Executable file
39
backend/modules/news/views/news/view.php
Executable file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var common\models\News $model */
|
||||
|
||||
$this->title = $model->title;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'News', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
<div class="news-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',
|
||||
'title',
|
||||
'text:ntext',
|
||||
'slug',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user