<leirás>
This commit is contained in:
@@ -14,12 +14,12 @@ return [
|
||||
'bootstrap' => ['log'],
|
||||
'modules' => [],
|
||||
'components' => [
|
||||
'request' => [
|
||||
/*'request' => [
|
||||
'csrfParam' => '_backendCSRF',
|
||||
'csrfCookie' => [
|
||||
'path' => '/backend/web',
|
||||
],
|
||||
],
|
||||
],*/
|
||||
'user' => [
|
||||
'identityClass' => 'common\models\User',
|
||||
'enableAutoLogin' => true,
|
||||
|
||||
@@ -38,7 +38,7 @@ class KeyController extends Controller
|
||||
// backend/views/kex/index.php
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
'dataProvider' => $dataProvider, //csomagoló osztály a queryhez
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ class KeySearch extends Key
|
||||
|
||||
$query->andFilterWhere([
|
||||
'id_key' => $this->id_key,
|
||||
'number' => $this->number,
|
||||
'status' => $this->status,
|
||||
'type' => $this->type,
|
||||
'created_at' => $this->created_at,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use common\models\Key;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Key */
|
||||
@@ -14,13 +15,13 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
<?= $form->field($model, 'number')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'status')->textInput() ?>
|
||||
<?= $form->field($model, 'status')->dropDownList( Key::statuses() ) /*->textInput()*/ ?>
|
||||
|
||||
<?= $form->field($model, 'type')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'created_at')->textInput() ?>
|
||||
<?php //echo $form->field($model, 'created_at')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'updated_at')->textInput() ?>
|
||||
<?php //echo $form->field($model, 'updated_at')->textInput() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend/key', 'Create') : Yii::t('backend/key', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use common\models\Key;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\KeySearch */
|
||||
@@ -15,21 +16,22 @@ use yii\widgets\ActiveForm;
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id_key') ?>
|
||||
<?php //echo $form->field($model, 'id_key') ?>
|
||||
|
||||
<?= $form->field($model, 'number') ?>
|
||||
<?php echo $form->field($model, 'number') ?>
|
||||
<?php //$form->field($model, 'status')->dropDownList( Key::statuses() ) /*->textInput()*/ ?>
|
||||
|
||||
<?= $form->field($model, 'status') ?>
|
||||
<?php //echo $form->field($model, 'status') ?>
|
||||
|
||||
<?= $form->field($model, 'type') ?>
|
||||
<?php //echo $form->field($model, 'type') ?>
|
||||
|
||||
<?= $form->field($model, 'created_at') ?>
|
||||
<?php //echo $form->field($model, 'created_at') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('backend/key', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton(Yii::t('backend/key', 'Reset'), ['class' => 'btn btn-default']) ?>
|
||||
<?php echo Html::resetButton(Yii::t('backend/key', 'Reset'), ['class' => 'btn btn-default']); /* Reset gomb */ ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
@@ -12,7 +12,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="key-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<h1>Új kulcs létrehozás <?php /*echo Html::encode($this->title)*/ ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use common\models\Key;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\KeySearch */
|
||||
@@ -11,23 +12,33 @@ $this->title = Yii::t('backend/key', 'Keys');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="key-index">
|
||||
asdf
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
<?php echo $this->render('_search', ['model' => $searchModel]); /* ezt megcsinálni hogy csak numberre lehessen itt a fitness-web/backend/views/key/_search.php töltődik be */?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('backend/key', 'Create Key'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
<?php
|
||||
// Új kulcs gomb kigenerálása a Yii::t('backend/key' a fitness-web/common/messages/hu/backend/key.php-ba lesz (miután létrehoztam)
|
||||
echo Html::a(Yii::t('backend/key', 'Create Key'), ['create'], ['class' => 'btn btn-success']);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
//'filterModel' => $searchModel, // ezt nem szeretjük
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id_key',
|
||||
// ['class' => 'yii\grid\SerialColumn'],
|
||||
// 'id_key',
|
||||
'number',
|
||||
'status',
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => function ($model, $key, $index, $column){
|
||||
$statuszok = Key::statuses();
|
||||
$result = $statuszok[$model->status];
|
||||
return $result;
|
||||
}
|
||||
],
|
||||
//'status',
|
||||
'type',
|
||||
'created_at',
|
||||
// 'updated_at',
|
||||
|
||||
Reference in New Issue
Block a user