Example #1
0
 /** @inheritdoc */
 public function actions()
 {
     return ['index' => ['class' => Index::class, 'searchModel' => Variable::class, 'nameVariableDataProvider' => 'data'], 'create' => ['class' => Create::class, 'newModel' => Variable::class, 'successMessage' => Module::t('Variable is create.'), 'redirectTo' => function (Variable $model) {
         return Url::to(['edit', 'id' => $model->id]);
     }], 'edit' => ['class' => Update::class, 'findModel' => [$this, 'findModel'], 'view' => 'edit', 'successMessage' => Module::t('Variable saved.')], 'delete' => ['class' => Delete::class, 'findModel' => [$this, 'findModel'], 'successMessage' => Module::t('Variable deleted.'), 'redirectTo' => ['index']]];
 }
Example #2
0
<?php

/**
 * @link https://github.com/roboapp
 * @copyright Copyright (c) 2016 Roboapp
 * @license [MIT License](https://opensource.org/licenses/MIT)
 */
/* @var $model roboapp\variable\models\Variable */
use roboapp\variable\Module;
$this->title = Module::t('Create variable');
echo $this->render('_menu');
echo $this->render('_form', ['model' => $model]);
Example #3
0
 /** @inheritdoc */
 public function attributeLabels()
 {
     return ['slug' => Module::t('Slug'), 'content' => Module::t('Content'), 'created_at' => Module::t('Create'), 'updated_at' => Module::t('Update')];
 }
Example #4
0
<?php

/**
 * @link https://github.com/roboapp
 * @copyright Copyright (c) 2016 Roboapp
 * @license [MIT License](https://opensource.org/licenses/MIT)
 */
/* @var $model roboapp\variable\models\Variable */
use roboapp\variable\Module;
$this->title = Module::t('Edit variable');
echo $this->render('_menu');
echo $this->render('_form', ['model' => $model]);
Example #5
0
<?php

/**
 * @link https://github.com/roboapp
 * @copyright Copyright (c) 2016 Roboapp
 * @license [MIT License](https://opensource.org/licenses/MIT)
 */
/* @var $this yii\web\View */
/* @var $model roboapp\variable\models\Variable */
use roboapp\variable\Module;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
$form = ActiveForm::begin(['enableAjaxValidation' => true, 'options' => ['class' => 'model-form']]);
?>

<?php 
echo $form->field($model, 'slug');
echo $form->field($model, 'content')->textarea();
?>

<?php 
echo Html::submitButton(Module::t('Save'), ['class' => 'btn btn-primary']);
ActiveForm::end();
Example #6
0
>
        <a href="<?php 
echo Url::to(['/admin/' . $module]);
?>
">
            <?php 
if ($action === 'edit') {
    ?>
                <i class="glyphicon glyphicon-chevron-left font-12"></i>
            <?php 
}
?>
            <?php 
echo Module::t('List');
?>
        </a>
    </li>
    <li <?php 
echo $action === 'create' ? 'class="active"' : '';
?>
>
        <a href="<?php 
echo Url::to(['/admin/' . $module . '/admin/create']);
?>
"><?php 
echo Module::t('Create');
?>
</a>
    </li>
</ul>
<br/>
Example #7
0
                    <?php 
        echo $item->content;
        ?>
                </td>
                <td>
                    <a href="<?php 
        echo Url::to(['/admin/' . $module->id . '/admin/delete', 'id' => $item->primaryKey]);
        ?>
"
                       class="glyphicon glyphicon-remove confirm-delete"
                       title="<?php 
        echo Module::t('Delete item');
        ?>
"></a>
                </td>
            </tr>
        <?php 
    }
    ?>
        </tbody>
    </table>
    <?php 
    echo yii\widgets\LinkPager::widget(['pagination' => $data->pagination]);
} else {
    ?>
    <p><?php 
    echo Module::t('No records found');
    ?>
</p>
<?php 
}