Skip to content

Commit

Permalink
Combo2 call updated, SwithcAction testing in DbController
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed May 12, 2015
1 parent 14a7658 commit 11923c6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
30 changes: 15 additions & 15 deletions controllers/DbController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Yii;
use yii\filters\VerbFilter;

class DBController extends CrudController
class DbController extends CrudController
{
public function behaviors()
{
Expand All @@ -34,7 +34,7 @@ public function actions()
'success' => Yii::t('app', 'DB delete task has been created successfully'),
'error' => Yii::t('app', 'Error while deleting DB'),
'POST html' => [
'save' => true,
'save' => true,
'success' => [
'class' => 'hipanel\actions\RedirectAction',
'url' => ['index'],
Expand All @@ -51,16 +51,16 @@ function ($model) {
],
],
'create' => [
'class' => 'hipanel\actions\SwitchAction',
'addFlash' => true,
'success' => Yii::t('app', 'DB delete task has been created successfully'),
'error' => Yii::t('app', 'Error while deleting DB'),
'GET html | GET pjax' => [
'class' => 'hipanel\actions\SwitchAction',
'addFlash' => true,
'success' => Yii::t('app', 'DB create task has been created successfully'),
'error' => Yii::t('app', 'Error while creating DB'),
'GET html | GET pjax' => [
'class' => 'hipanel\actions\RenderAction',
'view' => 'create',
'params' => $this->newModel(['scenario' => 'create'])
'params' => ['model' => $this->newModel(['scenario' => 'create'])],
],
'POST html' => [
'POST html' => [
'perform' => true,
'success' => [
'class' => 'hipanel\actions\RedirectAction',
Expand All @@ -69,7 +69,7 @@ function ($model) {
function ($model) {
return ['id' => $model->id];
}
],
]
],
'error' => [
'class' => 'hipanel\actions\RenderAction',
Expand All @@ -81,11 +81,11 @@ function ($model) {
],
],
],
'POST pjax' => [
'POST pjax' => [
'perform' => true,
'success' => [
'class' => 'hipanel\actions\RedirectAction',
'url' => [
'class' => 'hipanel\actions\RedirectAction',
'url' => [
'view',
function ($model) {
return ['id' => $model->id];
Expand All @@ -94,8 +94,8 @@ function ($model) {
'pjaxLocationHeader' => true,
],
'error' => [
'class' => 'hipanel\actions\RenderAction',
'url' => [
'class' => 'hipanel\actions\RenderAction',
'url' => [
'create',
function ($model) {
return [$model->model];
Expand Down
2 changes: 1 addition & 1 deletion views/account/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

?>

<?= accountGridView::widget([
<?= AccountGridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
Expand Down
18 changes: 13 additions & 5 deletions views/db/_form.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/* @var $this View */
/* @var $model frontend\modules\hosting\models\Db */
/* @var $model hipanel\modules\hosting\models\Db */
/* @var $type string */

use hipanel\base\View;
Expand All @@ -27,10 +27,18 @@
<!-- Properties -->

<?php
print $form->field($model, 'client')->widget(Combo2::className(), ['type' => 'client']);
print $form->field($model, 'server')->widget(Combo2::className(), ['type' => 'server']);
print $form->field($model, 'account')->widget(Combo2::className(), ['type' => 'account']);
print $form->field($model, 'service_id')->widget(Combo2::className(), ['type' => 'dbService', ]);
print $form->field($model, 'client')->widget(Combo2::className(), [
'class' => \hipanel\modules\client\assets\combo2\Client::className()
]);
print $form->field($model, 'server')->widget(Combo2::className(), [
'class' => \hipanel\modules\server\assets\combo2\Server::className()
]);
print $form->field($model, 'account')->widget(Combo2::className(), [
'class' => \hipanel\modules\hosting\assets\combo2\Account::className()
]);
print $form->field($model, 'service_id')->widget(Combo2::className(), [
'class' => \hipanel\modules\hosting\assets\combo2\DbService::className()
]);

print $form->field($model, 'name');
print $form->field($model, 'password')->widget(PasswordInput::className());
Expand Down

0 comments on commit 11923c6

Please sign in to comment.