Commit bdd0e60a by Junaid Rahman pv

Merge remote-tracking branch 'origin/development' into development

parents fed7b063 496fdd58
......@@ -9,13 +9,13 @@ use yii\helpers\Html;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo Yii::$app->charset ?>" />
<title><?php echo Html::encode($this->title) ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?= Yii::$app->charset ?>" />
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<?php echo $content ?>
<?= $content ?>
<?php $this->endBody() ?>
</body>
</html>
......
......@@ -12,19 +12,19 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'id')->textInput(['disabled'=>!$model->isNewRecord]) ?>
<?= $form->field($model, 'id')->textInput(['disabled'=>!$model->isNewRecord]) ?>
<?php if (!$model->isNewRecord): ?>
<?php echo $form->field($model, 'category')->textInput(['disabled'=>true]) ?>
<?php echo $form->field($model, 'sourceMessage')->textInput(['disabled'=>true]) ?>
<?= $form->field($model, 'category')->textInput(['disabled'=>true]) ?>
<?= $form->field($model, 'sourceMessage')->textInput(['disabled'=>true]) ?>
<?php endif; ?>
<?php echo $form->field($model, 'language')->textInput(['maxlength' => 16]) ?>
<?= $form->field($model, 'language')->textInput(['maxlength' => 16]) ?>
<?php echo $form->field($model, 'translation')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'translation')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -15,15 +15,15 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'language') ?>
<?= $form->field($model, 'language') ?>
<?php echo $form->field($model, 'translation') ?>
<?= $form->field($model, 'translation') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -10,7 +10,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="i18n-message-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model
]) ?>
......
......@@ -15,12 +15,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php //echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'I18n Message',
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -14,7 +14,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="i18n-message-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -12,12 +12,12 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'category')->textInput(['maxlength' => 32]) ?>
<?= $form->field($model, 'category')->textInput(['maxlength' => 32]) ?>
<?php echo $form->field($model, 'message')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'message')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -15,15 +15,15 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'category') ?>
<?= $form->field($model, 'category') ?>
<?php echo $form->field($model, 'message') ?>
<?= $form->field($model, 'message') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -10,7 +10,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="i18n-source-message-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model
]) ?>
......
......@@ -15,12 +15,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'I18n Source Message',
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -14,7 +14,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="i18n-source-message-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -12,11 +12,11 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="i18n-source-message-view">
<h1><?php echo Html::encode($this->title) ?></h1>
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?php echo Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?php echo Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
<?= Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('backend', 'Are you sure you want to delete this item?'),
......@@ -25,7 +25,7 @@ $this->params['breadcrumbs'][] = $this->title;
]) ?>
</p>
<?php echo DetailView::widget([
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
......
......@@ -64,6 +64,8 @@ class CategoryController extends Controller
{
$model = new Category();
$model->status = $model::STATUS_ACTIVE;
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
......
......@@ -2,6 +2,7 @@
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use trntv\filekit\widget\Upload;
/* @var $this yii\web\View */
/* @var $model common\models\Category */
......@@ -12,38 +13,72 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->errorSummary($model); ?>
<ul id="myTab" class="nav nav-tabs">
<li class="active">
<a href="#info" data-toggle="tab">
Info
</a>
</li>
<li>
<a href="#files" data-toggle="tab">
Files
</a>
</li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="info">
<div class="page-header">
<h3>Info</h3>
</div>
<div class="row">
<div class="col-md-3">
<div class="col-md-6">
<?php echo $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-md-3">
<?php echo $form->field($model, 'description')->textarea(['maxlength' => true]) ?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="col-md-6">
<?php echo $form->field($model, 'slug')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'status')->dropDownList($model::statuses(), ['prompt' => '']) ?>
</div>
<div class="row">
<div class="col-md-6">
<?php echo $form->field($model, 'description')->textarea(['rows' => '7']) ?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="col-md-6">
<?= $form->field($model, 'image')->widget(
\trntv\filekit\widget\Upload::className(),
Upload::className(),
[
'url' => ['/file-storage/upload'],
])->label('Image(1280x854)');
])->label('Image');
?>
</div>
</div>
<div class="row">
<div class="col-md-6">
<?= $form->field($model, 'status')->dropDownList($model::statuses(), ['prompt' => '']) ?>
</div>
</div>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend',
'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
</div>
<div class="tab-pane fade in" id="files">
<div class="page-header">
<h3>Files</h3>
</div>
</div>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -15,15 +15,15 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'name') ?>
<?= $form->field($model, 'name') ?>
<?php echo $form->field($model, 'slug') ?>
<?= $form->field($model, 'slug') ?>
<?php echo $form->field($model, 'description') ?>
<?= $form->field($model, 'description') ?>
<?php echo $form->field($model, 'image_url') ?>
<?= $form->field($model, 'image_url') ?>
<?php // echo $form->field($model, 'image_path') ?>
......@@ -34,8 +34,8 @@ use yii\bootstrap\ActiveForm;
<?php // echo $form->field($model, 'updated_at') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -14,7 +14,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="category-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -2,6 +2,8 @@
use yii\helpers\Html;
use yii\grid\GridView;
use common\grid\EnumColumn;
use common\models\Category;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\theme\models\search\CategorySearch */
......@@ -15,26 +17,32 @@ $this->params['breadcrumbs'][] = $this->title;
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'Category',
]), ['create'], ['class' => 'btn btn-success']) ?>
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
// 'id',
'name',
'slug',
// 'slug',
'description',
'image_url:url',
// 'image_path',
// 'status',
// 'created_at',
// 'updated_at',
// 'image_url:url',
// 'image_path',
[
'class' => EnumColumn::className(),
'attribute' => 'status',
'enum' => Category::statuses(),
'filter' => Category::statuses()
],
'status',
'created_at',
// 'updated_at',
['class' => 'yii\grid\ActionColumn'],
],
......
......@@ -14,7 +14,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="category-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -13,8 +13,8 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="category-view">
<p>
<?php echo Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?php echo Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
<?= Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('backend', 'Are you sure you want to delete this item?'),
......@@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
]) ?>
</p>
<?php echo DetailView::widget([
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
......
......@@ -27,23 +27,23 @@ $actionParamComments = $generator->generateActionParamComments();
echo "<?php\n";
?>
namespace <?php echo StringHelper::dirname(ltrim($generator->controllerClass, '\\')) ?>;
namespace <?= StringHelper::dirname(ltrim($generator->controllerClass, '\\')) ?>;
use Yii;
use <?php echo ltrim($generator->modelClass, '\\') ?>;
use <?= ltrim($generator->modelClass, '\\') ?>;
<?php if (!empty($generator->searchModelClass)): ?>
use <?php echo ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>;
use <?= ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>;
<?php else: ?>
use yii\data\ActiveDataProvider;
<?php endif; ?>
use <?php echo ltrim($generator->baseControllerClass, '\\') ?>;
use <?= ltrim($generator->baseControllerClass, '\\') ?>;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* <?php echo $controllerClass ?> implements the CRUD actions for <?php echo $modelClass ?> model.
* <?= $controllerClass ?> implements the CRUD actions for <?= $modelClass ?> model.
*/
class <?php echo $controllerClass ?> extends <?php echo StringHelper::basename($generator->baseControllerClass) . "\n" ?>
class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->baseControllerClass) . "\n" ?>
{
public function behaviors()
{
......@@ -58,13 +58,13 @@ class <?php echo $controllerClass ?> extends <?php echo StringHelper::basename($
}
/**
* Lists all <?php echo $modelClass ?> models.
* Lists all <?= $modelClass ?> models.
* @return mixed
*/
public function actionIndex()
{
<?php if (!empty($generator->searchModelClass)): ?>
$searchModel = new <?php echo isset($searchModelAlias) ? $searchModelAlias : $searchModelClass ?>();
$searchModel = new <?= isset($searchModelAlias) ? $searchModelAlias : $searchModelClass ?>();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
......@@ -73,7 +73,7 @@ class <?php echo $controllerClass ?> extends <?php echo StringHelper::basename($
]);
<?php else: ?>
$dataProvider = new ActiveDataProvider([
'query' => <?php echo $modelClass ?>::find(),
'query' => <?= $modelClass ?>::find(),
]);
return $this->render('index', [
......@@ -83,28 +83,28 @@ class <?php echo $controllerClass ?> extends <?php echo StringHelper::basename($
}
/**
* Displays a single <?php echo $modelClass ?> model.
* <?php echo implode("\n * ", $actionParamComments) . "\n" ?>
* Displays a single <?= $modelClass ?> model.
* <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed
*/
public function actionView(<?php echo $actionParams ?>)
public function actionView(<?= $actionParams ?>)
{
return $this->render('view', [
'model' => $this->findModel(<?php echo $actionParams ?>),
'model' => $this->findModel(<?= $actionParams ?>),
]);
}
/**
* Creates a new <?php echo $modelClass ?> model.
* Creates a new <?= $modelClass ?> model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new <?php echo $modelClass ?>();
$model = new <?= $modelClass ?>();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', <?php echo $urlParams ?>]);
return $this->redirect(['view', <?= $urlParams ?>]);
} else {
return $this->render('create', [
'model' => $model,
......@@ -113,17 +113,17 @@ class <?php echo $controllerClass ?> extends <?php echo StringHelper::basename($
}
/**
* Updates an existing <?php echo $modelClass ?> model.
* Updates an existing <?= $modelClass ?> model.
* If update is successful, the browser will be redirected to the 'view' page.
* <?php echo implode("\n * ", $actionParamComments) . "\n" ?>
* <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed
*/
public function actionUpdate(<?php echo $actionParams ?>)
public function actionUpdate(<?= $actionParams ?>)
{
$model = $this->findModel(<?php echo $actionParams ?>);
$model = $this->findModel(<?= $actionParams ?>);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', <?php echo $urlParams ?>]);
return $this->redirect(['view', <?= $urlParams ?>]);
} else {
return $this->render('update', [
'model' => $model,
......@@ -132,26 +132,26 @@ class <?php echo $controllerClass ?> extends <?php echo StringHelper::basename($
}
/**
* Deletes an existing <?php echo $modelClass ?> model.
* Deletes an existing <?= $modelClass ?> model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* <?php echo implode("\n * ", $actionParamComments) . "\n" ?>
* <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed
*/
public function actionDelete(<?php echo $actionParams ?>)
public function actionDelete(<?= $actionParams ?>)
{
$this->findModel(<?php echo $actionParams ?>)->delete();
$this->findModel(<?= $actionParams ?>)->delete();
return $this->redirect(['index']);
}
/**
* Finds the <?php echo $modelClass ?> model based on its primary key value.
* Finds the <?= $modelClass ?> model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* <?php echo implode("\n * ", $actionParamComments) . "\n" ?>
* @return <?php echo $modelClass ?> the loaded model
* <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return <?= $modelClass ?> the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel(<?php echo $actionParams ?>)
protected function findModel(<?= $actionParams ?>)
{
<?php
if (count($pks) === 1) {
......@@ -164,7 +164,7 @@ if (count($pks) === 1) {
$condition = '[' . implode(', ', $condition) . ']';
}
?>
if (($model = <?php echo $modelClass ?>::findOne(<?php echo $condition ?>)) !== null) {
if (($model = <?= $modelClass ?>::findOne(<?= $condition ?>)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
......
......@@ -22,17 +22,17 @@ $searchConditions = $generator->generateSearchConditions();
echo "<?php\n";
?>
namespace <?php echo StringHelper::dirname(ltrim($generator->searchModelClass, '\\')) ?>;
namespace <?= StringHelper::dirname(ltrim($generator->searchModelClass, '\\')) ?>;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use <?php echo ltrim($generator->modelClass, '\\') . (isset($modelAlias) ? " as $modelAlias" : "") ?>;
use <?= ltrim($generator->modelClass, '\\') . (isset($modelAlias) ? " as $modelAlias" : "") ?>;
/**
* <?php echo $searchModelClass ?> represents the model behind the search form about `<?php echo $generator->modelClass ?>`.
* <?= $searchModelClass ?> represents the model behind the search form about `<?= $generator->modelClass ?>`.
*/
class <?php echo $searchModelClass ?> extends <?php echo isset($modelAlias) ? $modelAlias : $modelClass ?>
class <?= $searchModelClass ?> extends <?= isset($modelAlias) ? $modelAlias : $modelClass ?>
{
/**
......@@ -41,7 +41,7 @@ class <?php echo $searchModelClass ?> extends <?php echo isset($modelAlias) ? $m
public function rules()
{
return [
<?php echo implode(",\n ", $rules) ?>,
<?= implode(",\n ", $rules) ?>,
];
}
......@@ -63,7 +63,7 @@ class <?php echo $searchModelClass ?> extends <?php echo isset($modelAlias) ? $m
*/
public function search($params)
{
$query = <?php echo isset($modelAlias) ? $modelAlias : $modelClass ?>::find();
$query = <?= isset($modelAlias) ? $modelAlias : $modelClass ?>::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
......@@ -73,7 +73,7 @@ class <?php echo $searchModelClass ?> extends <?php echo isset($modelAlias) ? $m
return $dataProvider;
}
<?php echo implode("\n ", $searchConditions) ?>
<?= implode("\n ", $searchConditions) ?>
return $dataProvider;
}
......
......@@ -20,25 +20,25 @@ use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
/* @var $this yii\web\View */
/* @var $model <?php echo ltrim($generator->modelClass, '\\') ?> */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/* @var $form yii\bootstrap\ActiveForm */
?>
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-form">
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-form">
<?php echo "<?php " ?>$form = ActiveForm::begin(); ?>
<?= "<?php " ?>$form = ActiveForm::begin(); ?>
<?php echo "<?php echo " ?>$form->errorSummary($model); ?>
<?= "<?= " ?>$form->errorSummary($model); ?>
<?php foreach ($generator->getColumnNames() as $attribute) {
if (in_array($attribute, $safeAttributes)) {
echo " <?php echo " . $generator->generateActiveField($attribute) . " ?>\n\n";
echo " <?= " . $generator->generateActiveField($attribute) . " ?>\n\n";
}
} ?>
<div class="form-group">
<?php echo "<?php echo " ?>Html::submitButton($model->isNewRecord ? <?php echo $generator->generateString('Create') ?> : <?php echo $generator->generateString('Update') ?>, ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= "<?= " ?>Html::submitButton($model->isNewRecord ? <?= $generator->generateString('Create') ?> : <?= $generator->generateString('Update') ?>, ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php echo "<?php " ?>ActiveForm::end(); ?>
<?= "<?php " ?>ActiveForm::end(); ?>
</div>
......@@ -13,13 +13,13 @@ use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
/* @var $this yii\web\View */
/* @var $model <?php echo ltrim($generator->searchModelClass, '\\') ?> */
/* @var $model <?= ltrim($generator->searchModelClass, '\\') ?> */
/* @var $form yii\bootstrap\ActiveForm */
?>
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-search">
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-search">
<?php echo "<?php " ?>$form = ActiveForm::begin([
<?= "<?php " ?>$form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
......@@ -28,17 +28,17 @@ use yii\bootstrap\ActiveForm;
$count = 0;
foreach ($generator->getColumnNames() as $attribute) {
if (++$count < 6) {
echo " <?php echo " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
echo " <?= " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
} else {
echo " <?php // echo " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
}
}
?>
<div class="form-group">
<?php echo "<?php echo " ?>Html::submitButton(<?php echo $generator->generateString('Search') ?>, ['class' => 'btn btn-primary']) ?>
<?php echo "<?php echo " ?>Html::resetButton(<?php echo $generator->generateString('Reset') ?>, ['class' => 'btn btn-default']) ?>
<?= "<?= " ?>Html::submitButton(<?= $generator->generateString('Search') ?>, ['class' => 'btn btn-primary']) ?>
<?= "<?= " ?>Html::resetButton(<?= $generator->generateString('Reset') ?>, ['class' => 'btn btn-default']) ?>
</div>
<?php echo "<?php " ?>ActiveForm::end(); ?>
<?= "<?php " ?>ActiveForm::end(); ?>
</div>
......@@ -13,15 +13,15 @@ use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model <?php echo ltrim($generator->modelClass, '\\') ?> */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
$this->title = <?php echo $generator->generateString('Create {modelClass}', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?>;
$this->params['breadcrumbs'][] = ['label' => <?php echo $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->title = <?= $generator->generateString('Create {modelClass}', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-create">
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-create">
<?php echo "<?php echo " ?>$this->render('_form', [
<?= "<?= " ?>$this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -13,29 +13,29 @@ echo "<?php\n";
?>
use yii\helpers\Html;
use <?php echo $generator->indexWidgetType === 'grid' ? "yii\\grid\\GridView" : "yii\\widgets\\ListView" ?>;
use <?= $generator->indexWidgetType === 'grid' ? "yii\\grid\\GridView" : "yii\\widgets\\ListView" ?>;
/* @var $this yii\web\View */
<?php echo !empty($generator->searchModelClass) ? "/* @var \$searchModel " . ltrim($generator->searchModelClass, '\\') . " */\n" : '' ?>
<?= !empty($generator->searchModelClass) ? "/* @var \$searchModel " . ltrim($generator->searchModelClass, '\\') . " */\n" : '' ?>
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = <?php echo $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>;
$this->title = <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>;
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-index">
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-index">
<?php if(!empty($generator->searchModelClass)): ?>
<?php echo " <?php " . ($generator->indexWidgetType === 'grid' ? "// " : "") ?>echo $this->render('_search', ['model' => $searchModel]); ?>
<?= " <?php " . ($generator->indexWidgetType === 'grid' ? "// " : "") ?>echo $this->render('_search', ['model' => $searchModel]); ?>
<?php endif; ?>
<p>
<?php echo "<?php echo " ?>Html::a(<?php echo $generator->generateString('Create {modelClass}', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?>, ['create'], ['class' => 'btn btn-success']) ?>
<?= "<?= " ?>Html::a(<?= $generator->generateString('Create {modelClass}', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?>, ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php if ($generator->indexWidgetType === 'grid'): ?>
<?php echo "<?php echo " ?>GridView::widget([
<?= "<?= " ?>GridView::widget([
'dataProvider' => $dataProvider,
<?php echo !empty($generator->searchModelClass) ? "'filterModel' => \$searchModel,\n 'columns' => [\n" : "'columns' => [\n"; ?>
<?= !empty($generator->searchModelClass) ? "'filterModel' => \$searchModel,\n 'columns' => [\n" : "'columns' => [\n"; ?>
['class' => 'yii\grid\SerialColumn'],
<?php
......@@ -64,11 +64,11 @@ if (($tableSchema = $generator->getTableSchema()) === false) {
],
]); ?>
<?php else: ?>
<?php echo "<?php echo " ?>ListView::widget([
<?= "<?= " ?>ListView::widget([
'dataProvider' => $dataProvider,
'itemOptions' => ['class' => 'item'],
'itemView' => function ($model, $key, $index, $widget) {
return Html::a(Html::encode($model-><?php echo $nameAttribute ?>), ['view', <?php echo $urlParams ?>]);
return Html::a(Html::encode($model-><?= $nameAttribute ?>), ['view', <?= $urlParams ?>]);
},
]) ?>
<?php endif; ?>
......
......@@ -14,16 +14,16 @@ echo "<?php\n";
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model <?php echo ltrim($generator->modelClass, '\\') ?> */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
$this->title = <?php echo $generator->generateString('Update {modelClass}: ', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?> . ' ' . $model-><?php echo $generator->getNameAttribute() ?>;
$this->params['breadcrumbs'][] = ['label' => <?php echo $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model-><?php echo $generator->getNameAttribute() ?>, 'url' => ['view', <?php echo $urlParams ?>]];
$this->params['breadcrumbs'][] = <?php echo $generator->generateString('Update') ?>;
$this->title = <?= $generator->generateString('Update {modelClass}: ', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?> . ' ' . $model-><?= $generator->getNameAttribute() ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model-><?= $generator->getNameAttribute() ?>, 'url' => ['view', <?= $urlParams ?>]];
$this->params['breadcrumbs'][] = <?= $generator->generateString('Update') ?>;
?>
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-update">
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-update">
<?php echo "<?php echo " ?>$this->render('_form', [
<?= "<?= " ?>$this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -15,26 +15,26 @@ use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model <?php echo ltrim($generator->modelClass, '\\') ?> */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
$this->title = $model-><?php echo $generator->getNameAttribute() ?>;
$this->params['breadcrumbs'][] = ['label' => <?php echo $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->title = $model-><?= $generator->getNameAttribute() ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-view">
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-view">
<p>
<?php echo "<?php echo " ?>Html::a(<?php echo $generator->generateString('Update') ?>, ['update', <?php echo $urlParams ?>], ['class' => 'btn btn-primary']) ?>
<?php echo "<?php echo " ?>Html::a(<?php echo $generator->generateString('Delete') ?>, ['delete', <?php echo $urlParams ?>], [
<?= "<?= " ?>Html::a(<?= $generator->generateString('Update') ?>, ['update', <?= $urlParams ?>], ['class' => 'btn btn-primary']) ?>
<?= "<?= " ?>Html::a(<?= $generator->generateString('Delete') ?>, ['delete', <?= $urlParams ?>], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => <?php echo $generator->generateString('Are you sure you want to delete this item?') ?>,
'confirm' => <?= $generator->generateString('Are you sure you want to delete this item?') ?>,
'method' => 'post',
],
]) ?>
</p>
<?php echo "<?php echo " ?>DetailView::widget([
<?= "<?= " ?>DetailView::widget([
'model' => $model,
'attributes' => [
<?php
......
......@@ -13,18 +13,18 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'title')->textInput(['maxlength' => 512]) ?>
<?= $form->field($model, 'title')->textInput(['maxlength' => 512]) ?>
<?php echo $form->field($model, 'slug')
<?= $form->field($model, 'slug')
->hint(Yii::t('backend', 'If you\'ll leave this field empty, slug will be generated automatically'))
->textInput(['maxlength' => 1024]) ?>
<?php echo $form->field($model, 'parent_id')->dropDownList($categories, ['prompt'=>'']) ?>
<?= $form->field($model, 'parent_id')->dropDownList($categories, ['prompt'=>'']) ?>
<?php echo $form->field($model, 'status')->checkbox() ?>
<?= $form->field($model, 'status')->checkbox() ?>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -15,17 +15,17 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'slug') ?>
<?= $form->field($model, 'slug') ?>
<?php echo $form->field($model, 'title') ?>
<?= $form->field($model, 'title') ?>
<?php echo $form->field($model, 'status') ?>
<?= $form->field($model, 'status') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -11,7 +11,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="article-category-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
'categories' => $categories
]) ?>
......
......@@ -15,12 +15,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'Article Category',
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -14,7 +14,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="article-category-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
'categories' => $categories,
]) ?>
......
......@@ -13,8 +13,8 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="article-category-view">
<p>
<?php echo Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?php echo Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
<?= Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('backend', 'Are you sure you want to delete this item?'),
......@@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
]) ?>
</p>
<?php echo DetailView::widget([
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
......
......@@ -15,19 +15,19 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
<?php echo $form->field($model, 'slug')
<?= $form->field($model, 'slug')
->hint(Yii::t('backend', 'If you\'ll leave this field empty, slug will be generated automatically'))
->textInput(['maxlength' => true]) ?>
<?php echo $form->field($model, 'category_id')->dropDownList(\yii\helpers\ArrayHelper::map(
<?= $form->field($model, 'category_id')->dropDownList(\yii\helpers\ArrayHelper::map(
$categories,
'id',
'title'
), ['prompt'=>'']) ?>
<?php echo $form->field($model, 'body')->widget(
<?= $form->field($model, 'body')->widget(
\yii\imperavi\Widget::className(),
[
'plugins' => ['fullscreen', 'fontcolor', 'video'],
......@@ -42,7 +42,7 @@ use yii\bootstrap\ActiveForm;
]
) ?>
<?php echo $form->field($model, 'thumbnail')->widget(
<?= $form->field($model, 'thumbnail')->widget(
Upload::className(),
[
'url' => ['/file-storage/upload'],
......@@ -50,7 +50,7 @@ use yii\bootstrap\ActiveForm;
]);
?>
<?php echo $form->field($model, 'attachments')->widget(
<?= $form->field($model, 'attachments')->widget(
Upload::className(),
[
'url' => ['/file-storage/upload'],
......@@ -60,11 +60,11 @@ use yii\bootstrap\ActiveForm;
]);
?>
<?php echo $form->field($model, 'view')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'view')->textInput(['maxlength' => true]) ?>
<?php echo $form->field($model, 'status')->checkbox() ?>
<?= $form->field($model, 'status')->checkbox() ?>
<?php echo $form->field($model, 'published_at')->widget(
<?= $form->field($model, 'published_at')->widget(
DateTimeWidget::className(),
[
'phpDatetimeFormat' => 'yyyy-MM-dd\'T\'HH:mm:ssZZZZZ'
......@@ -72,7 +72,7 @@ use yii\bootstrap\ActiveForm;
) ?>
<div class="form-group">
<?php echo Html::submitButton(
<?= Html::submitButton(
$model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'),
['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
......
......@@ -15,15 +15,15 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'slug') ?>
<?= $form->field($model, 'slug') ?>
<?php echo $form->field($model, 'title') ?>
<?= $form->field($model, 'title') ?>
<?php echo $form->field($model, 'body') ?>
<?= $form->field($model, 'body') ?>
<?php echo $form->field($model, 'user_id') ?>
<?= $form->field($model, 'user_id') ?>
<?php // echo $form->field($model, 'status') ?>
......@@ -34,8 +34,8 @@ use yii\bootstrap\ActiveForm;
<?php // echo $form->field($model, 'updated_at') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -11,7 +11,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="article-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
'categories' => $categories
]) ?>
......
......@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="article-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
'categories' => $categories,
]) ?>
......
......@@ -11,7 +11,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="article-index">
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
'name',
......@@ -33,32 +33,32 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="row">
<div class="col-xs-6">
<h4><?php echo Yii::t('backend', 'Delete a value with the specified key from cache') ?></h4>
<h4><?= Yii::t('backend', 'Delete a value with the specified key from cache') ?></h4>
<?php \yii\bootstrap\ActiveForm::begin([
'action'=>\yii\helpers\Url::to('flush-cache-key'),
'method'=>'get',
'layout'=>'inline',
]) ?>
<?php echo Html::dropDownList(
<?= Html::dropDownList(
'id', null, \yii\helpers\ArrayHelper::map($dataProvider->allModels, 'name', 'name'),
['class'=>'form-control', 'prompt'=> Yii::t('backend', 'Select cache')])
?>
<?php echo Html::input('string', 'key', null, ['class'=>'form-control', 'placeholder' => Yii::t('backend', 'Key')]) ?>
<?php echo Html::submitButton(Yii::t('backend', 'Flush'), ['class'=>'btn btn-danger']) ?>
<?= Html::input('string', 'key', null, ['class'=>'form-control', 'placeholder' => Yii::t('backend', 'Key')]) ?>
<?= Html::submitButton(Yii::t('backend', 'Flush'), ['class'=>'btn btn-danger']) ?>
<?php \yii\bootstrap\ActiveForm::end() ?>
</div>
<div class="col-xs-6">
<h4><?php echo Yii::t('backend', 'Invalidate tag') ?></h4>
<h4><?= Yii::t('backend', 'Invalidate tag') ?></h4>
<?php \yii\bootstrap\ActiveForm::begin([
'action'=>\yii\helpers\Url::to('flush-cache-tag'),
'method'=>'get',
'layout'=>'inline'
]) ?>
<?php echo Html::dropDownList(
<?= Html::dropDownList(
'id', null, \yii\helpers\ArrayHelper::map($dataProvider->allModels, 'name', 'name'),
['class'=>'form-control', 'prompt'=> Yii::t('backend', 'Select cache')]) ?>
<?php echo Html::input('string', 'tag', null, ['class'=>'form-control', 'placeholder' => Yii::t('backend', 'Tag')]) ?>
<?php echo Html::submitButton(Yii::t('backend', 'Flush'), ['class'=>'btn btn-danger']) ?>
<?= Html::input('string', 'tag', null, ['class'=>'form-control', 'placeholder' => Yii::t('backend', 'Tag')]) ?>
<?= Html::submitButton(Yii::t('backend', 'Flush'), ['class'=>'btn btn-danger']) ?>
<?php \yii\bootstrap\ActiveForm::end() ?>
</div>
</div>
......
......@@ -5,7 +5,7 @@ $this->title = Yii::t('backend', 'File Manager')
<div class="row">
<div class="col-xs-12">
<?php echo \mihaildev\elfinder\ElFinder::widget([
<?= \mihaildev\elfinder\ElFinder::widget([
'controller' => 'file-manager-elfinder',
'frameOptions' => ['style'=>'min-height: 500px; width: 100%; border: 0'],
]);
......
......@@ -15,15 +15,15 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'component') ?>
<?= $form->field($model, 'component') ?>
<?php echo $form->field($model, 'base_url') ?>
<?= $form->field($model, 'base_url') ?>
<?php echo $form->field($model, 'path') ?>
<?= $form->field($model, 'path') ?>
<?php echo $form->field($model, 'type') ?>
<?= $form->field($model, 'type') ?>
<?php // echo $form->field($model, 'size') ?>
......@@ -34,8 +34,8 @@ use yii\bootstrap\ActiveForm;
<?php // echo $form->field($model, 'created_at') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -20,10 +20,10 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="col-xs-12">
<dl>
<dt>
<?php echo Yii::t('backend', 'Used size') ?>:
<?= Yii::t('backend', 'Used size') ?>:
</dt>
<dd>
<?php echo Yii::$app->formatter->asSize($totalSize); ?>
<?= Yii::$app->formatter->asSize($totalSize); ?>
</dd>
</dl>
</div>
......@@ -33,10 +33,10 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="col-xs-12">
<dl>
<dt>
<?php echo Yii::t('backend', 'Count') ?>:
<?= Yii::t('backend', 'Count') ?>:
</dt>
<dd>
<?php echo $dataProvider->totalCount ?>
<?= $dataProvider->totalCount ?>
</dd>
</dl>
</div>
......@@ -44,7 +44,7 @@ $this->params['breadcrumbs'][] = $this->title;
</div>
</div>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -13,8 +13,8 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="file-storage-item-view">
<p>
<?php echo Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?php echo Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
<?= Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('backend', 'Are you sure you want to delete this item?'),
......@@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
]) ?>
</p>
<?php echo DetailView::widget([
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
......
......@@ -12,14 +12,14 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'key')->textInput() ?>
<?= $form->field($model, 'key')->textInput() ?>
<?php echo $form->field($model, 'value')->textInput() ?>
<?= $form->field($model, 'value')->textInput() ?>
<?php echo $form->field($model, 'comment')->textarea() ?>
<?= $form->field($model, 'comment')->textarea() ?>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -10,7 +10,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="key-storage-item-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model
]) ?>
......
......@@ -15,12 +15,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'Key Storage Item',
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="key-storage-item-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -15,17 +15,17 @@ $this->params['body-class'] = array_key_exists('body-class', $this->params) ?
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?php echo Yii::$app->language ?>">
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?php echo Yii::$app->charset ?>">
<meta charset="<?= Yii::$app->charset ?>">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<?php echo Html::csrfMetaTags() ?>
<title><?php echo Html::encode($this->title) ?></title>
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
<?php echo Html::beginTag('body', [
<?= Html::beginTag('body', [
'class' => implode(' ', [
ArrayHelper::getValue($this->params, 'body-class'),
Yii::$app->keyStorage->get('backend.theme-skin', 'skin-blue'),
......@@ -35,8 +35,8 @@ $this->params['body-class'] = array_key_exists('body-class', $this->params) ?
])
])?>
<?php $this->beginBody() ?>
<?php echo $content ?>
<?= $content ?>
<?php $this->endBody() ?>
<?php echo Html::endTag('body') ?>
<?= Html::endTag('body') ?>
</html>
<?php $this->endPage() ?>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<?php $this->beginContent('@backend/views/layouts/common.php'); ?>
<div class="box">
<div class="box-body">
<?php echo $content ?>
<?= $content ?>
</div>
</div>
<?php $this->endContent(); ?>
\ No newline at end of file
......@@ -15,21 +15,21 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'level') ?>
<?= $form->field($model, 'level') ?>
<?php echo $form->field($model, 'category') ?>
<?= $form->field($model, 'category') ?>
<?php echo $form->field($model, 'log_time') ?>
<?= $form->field($model, 'log_time') ?>
<?php echo $form->field($model, 'prefix') ?>
<?= $form->field($model, 'prefix') ?>
<?php echo $form->field($model, 'message') ?>
<?= $form->field($model, 'message') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -13,12 +13,12 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="system-log-index">
<p>
<?php echo Html::a(Yii::t('backend', 'Clear'), false, ['class' => 'btn btn-danger', 'data-method'=>'delete']) ?>
<?= Html::a(Yii::t('backend', 'Clear'), false, ['class' => 'btn btn-danger', 'data-method'=>'delete']) ?>
</p>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -13,10 +13,10 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="system-log-view">
<p>
<?php echo Html::a(Yii::t('backend', 'Delete'), ['delete', 'id'=>$model->id], ['class' => 'btn btn-danger', 'data'=>['method'=>'post']]) ?>
<?= Html::a(Yii::t('backend', 'Delete'), ['delete', 'id'=>$model->id], ['class' => 'btn btn-danger', 'data'=>['method'=>'post']]) ?>
</p>
<?php echo DetailView::widget([
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
......
......@@ -12,11 +12,11 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
<?php echo $form->field($model, 'slug')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'slug')->textInput(['maxlength' => true]) ?>
<?php echo $form->field($model, 'body')->widget(
<?= $form->field($model, 'body')->widget(
\yii\imperavi\Widget::className(),
[
'plugins' => ['fullscreen', 'fontcolor', 'video'],
......@@ -29,12 +29,12 @@ use yii\bootstrap\ActiveForm;
]
) ?>
<?php echo $form->field($model, 'view')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'view')->textInput(['maxlength' => true]) ?>
<?php echo $form->field($model, 'status')->checkbox() ?>
<?= $form->field($model, 'status')->checkbox() ?>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -15,19 +15,19 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'slug') ?>
<?= $form->field($model, 'slug') ?>
<?php echo $form->field($model, 'title') ?>
<?= $form->field($model, 'title') ?>
<?php echo $form->field($model, 'body') ?>
<?= $form->field($model, 'body') ?>
<?php echo $form->field($model, 'status') ?>
<?= $form->field($model, 'status') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -10,7 +10,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model
]) ?>
......
......@@ -15,12 +15,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'Page',
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="page-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -13,16 +13,16 @@ $this->title = Yii::t('backend', 'Edit account')
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'username') ?>
<?= $form->field($model, 'username') ?>
<?php echo $form->field($model, 'email') ?>
<?= $form->field($model, 'email') ?>
<?php echo $form->field($model, 'password')->passwordInput() ?>
<?= $form->field($model, 'password')->passwordInput() ?>
<?php echo $form->field($model, 'password_confirm')->passwordInput() ?>
<?= $form->field($model, 'password_confirm')->passwordInput() ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Update'), ['class' => 'btn btn-primary']) ?>
<?= Html::submitButton(Yii::t('backend', 'Update'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -12,18 +12,18 @@ $this->params['body-class'] = 'login-page';
?>
<div class="login-box">
<div class="login-logo">
<?php echo Html::encode($this->title) ?>
<?= Html::encode($this->title) ?>
</div><!-- /.login-logo -->
<div class="header"></div>
<div class="login-box-body">
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
<div class="body">
<?php echo $form->field($model, 'username') ?>
<?php echo $form->field($model, 'password')->passwordInput() ?>
<?php echo $form->field($model, 'rememberMe')->checkbox(['class'=>'simple']) ?>
<?= $form->field($model, 'username') ?>
<?= $form->field($model, 'password')->passwordInput() ?>
<?= $form->field($model, 'rememberMe')->checkbox(['class'=>'simple']) ?>
</div>
<div class="footer">
<?php echo Html::submitButton(Yii::t('backend', 'Sign me in'), [
<?= Html::submitButton(Yii::t('backend', 'Sign me in'), [
'class' => 'btn btn-primary btn-flat btn-block',
'name' => 'login-button'
]) ?>
......
......@@ -15,25 +15,25 @@ $this->title = Yii::t('backend', 'Edit profile')
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'picture')->widget(\trntv\filekit\widget\Upload::classname(), [
<?= $form->field($model, 'picture')->widget(\trntv\filekit\widget\Upload::classname(), [
'url'=>['avatar-upload']
]) ?>
<?php echo $form->field($model, 'firstname')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'firstname')->textInput(['maxlength' => 255]) ?>
<?php echo $form->field($model, 'middlename')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'middlename')->textInput(['maxlength' => 255]) ?>
<?php echo $form->field($model, 'lastname')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'lastname')->textInput(['maxlength' => 255]) ?>
<?php echo $form->field($model, 'locale')->dropDownlist(Yii::$app->params['availableLocales']) ?>
<?= $form->field($model, 'locale')->dropDownlist(Yii::$app->params['availableLocales']) ?>
<?php echo $form->field($model, 'gender')->dropDownlist([
<?= $form->field($model, 'gender')->dropDownlist([
UserProfile::GENDER_FEMALE => Yii::t('backend', 'Female'),
UserProfile::GENDER_MALE => Yii::t('backend', 'Male')
]) ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Update'), ['class' => 'btn btn-primary']) ?>
<?= Html::submitButton(Yii::t('backend', 'Update'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -15,7 +15,7 @@ $this->title = $name;
<div class="error-content text-center">
<h3 class="headline">
<i class="fa fa-warning text-yellow"></i>
<?php echo Yii::t(
<?= Yii::t(
'backend',
'Error {code}',
[
......@@ -24,7 +24,7 @@ $this->title = $name;
?>
</h3>
<p>
<?php echo nl2br(Html::encode($message)) ?>
<?= nl2br(Html::encode($message)) ?>
</p>
</div>
</div>
......
......@@ -6,7 +6,7 @@ $this->title = Yii::t('backend', 'Application settings');
?>
<div class="box">
<div class="box-body">
<?php echo \common\components\keyStorage\FormWidget::widget([
<?= \common\components\keyStorage\FormWidget::widget([
'model' => $model,
'formClass' => '\yii\bootstrap\ActiveForm',
'submitText' => Yii::t('backend', 'Save'),
......
......@@ -6,7 +6,7 @@ use yii\helpers\Html;
$this->title = Yii::t('backend', 'System Information');
?>
<?php echo Yii::t(
<?= Yii::t(
'backend',
'Sorry, application failed to collect information about your system. See {link}.',
['link' => Html::a('trntv/probe', 'https://github.com/trntv/probe#user-content-supported-os')]
......
......@@ -7,25 +7,25 @@
<div class="timeline-item">
<span class="time">
<i class="fa fa-clock-o"></i>
<?php echo Yii::$app->formatter->asRelativeTime($model->created_at) ?>
<?= Yii::$app->formatter->asRelativeTime($model->created_at) ?>
</span>
<h3 class="timeline-header">
<?php echo Yii::t('backend', 'You have new event') ?>
<?= Yii::t('backend', 'You have new event') ?>
</h3>
<div class="timeline-body">
<dl>
<dt><?php echo Yii::t('backend', 'Application') ?>:</dt>
<dd><?php echo $model->application ?></dd>
<dt><?= Yii::t('backend', 'Application') ?>:</dt>
<dd><?= $model->application ?></dd>
<dt><?php echo Yii::t('backend', 'Category') ?>:</dt>
<dd><?php echo $model->category ?></dd>
<dt><?= Yii::t('backend', 'Category') ?>:</dt>
<dd><?= $model->category ?></dd>
<dt><?php echo Yii::t('backend', 'Event') ?>:</dt>
<dd><?php echo $model->event ?></dd>
<dt><?= Yii::t('backend', 'Event') ?>:</dt>
<dd><?= $model->event ?></dd>
<dt><?php echo Yii::t('backend', 'Date') ?>:</dt>
<dd><?php echo Yii::$app->formatter->asDatetime($model->created_at) ?></dd>
<dt><?= Yii::t('backend', 'Date') ?>:</dt>
<dd><?= Yii::$app->formatter->asDatetime($model->created_at) ?></dd>
</dl>
</div>
</div>
\ No newline at end of file
......@@ -15,15 +15,15 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'application') ?>
<?= $form->field($model, 'application') ?>
<?php echo $form->field($model, 'event') ?>
<?= $form->field($model, 'event') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -20,7 +20,7 @@ $icons = [
<!-- timeline time label -->
<li class="time-label">
<span class="bg-blue">
<?php echo Yii::$app->formatter->asDate($model->created_at) ?>
<?= Yii::$app->formatter->asDate($model->created_at) ?>
</span>
</li>
<?php $date = Yii::$app->formatter->asDate($model->created_at) ?>
......@@ -42,11 +42,11 @@ $icons = [
</li>
</ul>
<?php else: ?>
<?php echo Yii::t('backend', 'No events found') ?>
<?= Yii::t('backend', 'No events found') ?>
<?php endif; ?>
</div>
<div class="col-md-12 text-center">
<?php echo \yii\widgets\LinkPager::widget([
<?= \yii\widgets\LinkPager::widget([
'pagination'=>$dataProvider->pagination,
'options' => ['class' => 'pagination']
]) ?>
......
......@@ -7,22 +7,22 @@
<div class="timeline-item">
<span class="time">
<i class="fa fa-clock-o"></i>
<?php echo Yii::$app->formatter->asRelativeTime($model->created_at) ?>
<?= Yii::$app->formatter->asRelativeTime($model->created_at) ?>
</span>
<h3 class="timeline-header">
<?php echo Yii::t('backend', 'You have new user!') ?>
<?= Yii::t('backend', 'You have new user!') ?>
</h3>
<div class="timeline-body">
<?php echo Yii::t('backend', 'New user ({identity}) was registered at {created_at}', [
<?= Yii::t('backend', 'New user ({identity}) was registered at {created_at}', [
'identity' => $model->data['public_identity'],
'created_at' => Yii::$app->formatter->asDatetime($model->data['created_at'])
]) ?>
</div>
<div class="timeline-footer">
<?php echo \yii\helpers\Html::a(
<?= \yii\helpers\Html::a(
Yii::t('backend', 'View user'),
['/user/view', 'id' => $model->data['user_id']],
['class' => 'btn btn-success btn-sm']
......
......@@ -14,13 +14,13 @@ use yii\bootstrap\ActiveForm;
<div class="user-form">
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'username') ?>
<?php echo $form->field($model, 'email') ?>
<?php echo $form->field($model, 'password')->passwordInput() ?>
<?php echo $form->field($model, 'status')->dropDownList(User::statuses()) ?>
<?php echo $form->field($model, 'roles')->checkboxList($roles) ?>
<?= $form->field($model, 'username') ?>
<?= $form->field($model, 'email') ?>
<?= $form->field($model, 'password')->passwordInput() ?>
<?= $form->field($model, 'status')->dropDownList(User::statuses()) ?>
<?= $form->field($model, 'roles')->checkboxList($roles) ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Save'), ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>
<?= Html::submitButton(Yii::t('backend', 'Save'), ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -15,25 +15,25 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'username') ?>
<?= $form->field($model, 'username') ?>
<?php echo $form->field($model, 'auth_key') ?>
<?= $form->field($model, 'auth_key') ?>
<?php echo $form->field($model, 'email') ?>
<?= $form->field($model, 'email') ?>
<?php echo $form->field($model, 'role') ?>
<?= $form->field($model, 'role') ?>
<?php echo $form->field($model, 'status') ?>
<?= $form->field($model, 'status') ?>
<?php echo $form->field($model, 'created_at') ?>
<?= $form->field($model, 'created_at') ?>
<?php echo $form->field($model, 'updated_at') ?>
<?= $form->field($model, 'updated_at') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -10,7 +10,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
'roles' => $roles
]) ?>
......
......@@ -17,12 +17,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'User',
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = ['label'=>Yii::t('backend', 'Update')];
?>
<div class="user-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
'roles' => $roles
]) ?>
......
......@@ -13,8 +13,8 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="user-view">
<p>
<?php echo Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?php echo Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
<?= Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('backend', 'Are you sure you want to delete this item?'),
......@@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
]) ?>
</p>
<?php echo DetailView::widget([
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
......
......@@ -12,12 +12,12 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'key')->textInput(['maxlength' => 1024]) ?>
<?= $form->field($model, 'key')->textInput(['maxlength' => 1024]) ?>
<?php echo $form->field($model, 'status')->checkbox() ?>
<?= $form->field($model, 'status')->checkbox() ?>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -10,7 +10,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="widget-carousel-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model
]) ?>
......
......@@ -13,12 +13,12 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="widget-carousel-index">
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'Widget Carousel',
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'options' => [
......
......@@ -12,20 +12,20 @@ use yii\helpers\Html;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->errorSummary($model) ?>
<?= $form->errorSummary($model) ?>
<?php echo $form->field($model, 'image')->widget(
<?= $form->field($model, 'image')->widget(
\trntv\filekit\widget\Upload::className(),
[
'url'=>['/file-storage/upload'],
]
) ?>
<?php echo $form->field($model, 'order')->textInput() ?>
<?= $form->field($model, 'order')->textInput() ?>
<?php echo $form->field($model, 'url')->textInput(['maxlength' => 1024]) ?>
<?= $form->field($model, 'url')->textInput(['maxlength' => 1024]) ?>
<?php echo $form->field($model, 'caption')->widget(
<?= $form->field($model, 'caption')->widget(
\yii\imperavi\Widget::className(),
[
'plugins' => ['fullscreen', 'fontcolor', 'video'],
......@@ -38,10 +38,10 @@ use yii\helpers\Html;
]
]) ?>
<?php echo $form->field($model, 'status')->checkbox() ?>
<?= $form->field($model, 'status')->checkbox() ?>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Create');
?>
<div class="widget-carousel-item-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model
]) ?>
......
......@@ -14,7 +14,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="widget-carousel-item-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -14,17 +14,17 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="widget-carousel-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'Widget Carousel Item',
]), ['/widget-carousel-item/create', 'carousel_id'=>$model->id], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $carouselItemsProvider,
'options' => [
'class' => 'grid-view table-responsive'
......
......@@ -12,23 +12,23 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->errorSummary($model) ?>
<?= $form->errorSummary($model) ?>
<?php echo $form->field($model, 'key')->textInput(['maxlength' => 1024]) ?>
<?= $form->field($model, 'key')->textInput(['maxlength' => 1024]) ?>
<?php echo $form->field($model, 'title')->textInput(['maxlength' => 512]) ?>
<?= $form->field($model, 'title')->textInput(['maxlength' => 512]) ?>
<?php echo $form->field($model, 'items')->widget(
<?= $form->field($model, 'items')->widget(
trntv\aceeditor\AceEditor::className(),
[
'mode' => 'json'
]
) ?>
<?php echo $form->field($model, 'status')->checkbox() ?>
<?= $form->field($model, 'status')->checkbox() ?>
<div class="form-group">
<?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -10,7 +10,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="widget-menu-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="widget-menu-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
......@@ -12,21 +12,21 @@ use yii\bootstrap\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($model, 'key')->textInput(['maxlength' => 1024]) ?>
<?= $form->field($model, 'key')->textInput(['maxlength' => 1024]) ?>
<?php echo $form->field($model, 'title')->textInput(['maxlength' => 512]) ?>
<?= $form->field($model, 'title')->textInput(['maxlength' => 512]) ?>
<?php echo $form->field($model, 'body')->widget(
<?= $form->field($model, 'body')->widget(
trntv\aceeditor\AceEditor::className(),
[
'mode' => 'html'
]
) ?>
<?php echo $form->field($model, 'status')->checkbox() ?>
<?= $form->field($model, 'status')->checkbox() ?>
<div class="form-group">
<?php echo Html::submitButton(
<?= Html::submitButton(
$model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'),
['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']
) ?>
......
......@@ -14,19 +14,19 @@ use yii\bootstrap\ActiveForm;
'method' => 'get',
]); ?>
<?php echo $form->field($model, 'id') ?>
<?= $form->field($model, 'id') ?>
<?php echo $form->field($model, 'key') ?>
<?= $form->field($model, 'key') ?>
<?php echo $form->field($model, 'title') ?>
<?= $form->field($model, 'title') ?>
<?php echo $form->field($model, 'body') ?>
<?= $form->field($model, 'body') ?>
<?php echo $form->field($model, 'status') ?>
<?= $form->field($model, 'status') ?>
<div class="form-group">
<?php echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?php echo Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('backend', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
......
......@@ -10,7 +10,7 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="text-block-create">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model
]) ?>
......
......@@ -15,12 +15,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php echo Html::a(Yii::t('backend', 'Create {modelClass}', [
<?= Html::a(Yii::t('backend', 'Create {modelClass}', [
'modelClass' => 'Text Block',
]), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo GridView::widget([
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
......
......@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = Yii::t('backend', 'Update');
?>
<div class="text-block-update">
<?php echo $this->render('_form', [
<?= $this->render('_form', [
'model' => $model,
]) ?>
......
<?php
$config = [
'name'=>'Yii2 Starter Kit',
'name'=>'Libromi Web',
'vendorPath'=>dirname(dirname(__DIR__)).'/vendor',
'extensions' => require(__DIR__ . '/../../vendor/yiisoft/extensions.php'),
'sourceLanguage'=>'en-US',
......
......@@ -4,6 +4,9 @@ namespace common\models;
use Yii;
use common\models\query\CategoryQuery;
use yii\behaviors\SluggableBehavior;
use yii\behaviors\TimestampBehavior;
use trntv\filekit\behaviors\UploadBehavior;
/**
* This is the model class for table "{{%category}}".
......@@ -25,6 +28,7 @@ class Category extends \yii\db\ActiveRecord
const STATUS_ACTIVE = 1;
const STATUS_IN_ACTIVE = 2;
public $image;
/**
* @inheritdoc
......@@ -40,11 +44,12 @@ class Category extends \yii\db\ActiveRecord
public function rules()
{
return [
[['name', 'slug', 'status'], 'required'],
[['name', 'status'], 'required'],
[['status', 'created_at', 'updated_at'], 'integer'],
[['name', 'slug'], 'string', 'max' => 32],
[['description'], 'string', 'max' => 512],
[['image_url', 'image_path'], 'string', 'max' => 1024],
[['image'], 'safe']
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment