kulcsok új és szerkesztési nézetek fordítása, legördülő lista alkalmazása type-ra

This commit is contained in:
rocho
2015-12-01 17:55:28 +01:00
parent 4872abbb20
commit 783d889ec7
8 changed files with 36 additions and 11 deletions

View File

@@ -18,8 +18,9 @@ class KeySearch extends Key
public function rules()
{
return [
[['id_key', 'status', 'type'], 'integer'],
[['number', 'created_at', 'updated_at'], 'safe'],
/*[['id_key', 'status', 'type'], 'integer'],
[['number', 'created_at', 'updated_at'], 'safe'],*/
[['number'], 'safe']
];
}

View File

@@ -17,14 +17,14 @@ use common\models\Key;
<?= $form->field($model, 'status')->dropDownList( Key::statuses() ) /*->textInput()*/ ?>
<?= $form->field($model, 'type')->textInput() ?>
<?= $form->field($model, 'type')->dropDownList( Key::types() /* array(10=>"kulcs") // <--ez így ok */ ) /* $form->field($model, 'type')->textInput() */ ?>
<?php //echo $form->field($model, 'created_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']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend/key', 'Create Save') : Yii::t('backend/key', 'Update Save'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>

View File

@@ -10,7 +10,10 @@ use common\models\Key;
?>
<div class="key-search">
<div class="row">
<div class="col-md-4">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
@@ -31,9 +34,11 @@ use common\models\Key;
<div class="form-group">
<?= Html::submitButton(Yii::t('backend/key', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend/key', 'Reset'), ['class' => 'btn btn-default']); /* Reset gomb */ ?>
<?php //echo Html::resetButton(Yii::t('backend/key', 'Reset'), ['class' => 'btn btn-default']); /* Reset gomb */ ?>
</div>
<?php ActiveForm::end(); ?>
</div><!-- col-md-4 END -->
</div><!-- row END -->
</div>

View File

@@ -1,7 +1,7 @@
<?php
use yii\helpers\Html;
use common\models\Key;
/* @var $this yii\web\View */
/* @var $model common\models\Key */

View File

@@ -11,7 +11,7 @@ use common\models\Key;
$this->title = Yii::t('backend/key', 'Keys');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="key-index">
<div class="key-index">
<h1><?= Html::encode($this->title) ?></h1>
<?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 */?>
@@ -43,7 +43,10 @@ $this->params['breadcrumbs'][] = $this->title;
'created_at',
// 'updated_at',
['class' => 'yii\grid\ActionColumn'],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update}',
],
],
]); ?>

View File

@@ -1,6 +1,7 @@
<?php
use yii\helpers\Html;
use common\models\Key;
/* @var $this yii\web\View */
/* @var $model common\models\Key */