<?php use yii\helpers\Html; use simplator\threads\Module; /* @var $this yii\web\View */ /* @var $model simplator\threads\models\Comment */ $this->title = Module::t('threads', 'Create Comment'); $this->params['breadcrumbs'][] = ['label' => Module::t('threads', 'Comments'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="comment-create"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo $this->render('_form', ['model' => $model]); ?> </div>
/** * @inheritdoc */ public function attributeLabels() { return ['id' => Module::t('threads', 'ID'), 'module' => Module::t('threads', 'Module'), 'itemid' => Module::t('threads', 'Itemid'), 'time' => Module::t('threads', 'Time'), 'text' => Module::t('threads', 'Text'), 'authorid' => Module::t('threads', 'Authorid'), 'authorname' => Module::t('threads', 'Authorname'), 'status' => Module::t('threads', 'Status')]; }
<?php } else { ?> <?php $form = ActiveForm::begin(['id' => 'threads-comments-form-' . $model->thread, 'fieldConfig' => ['template' => "{input}\n{error}"], 'action' => $action]); echo $form->field($model, 'thread')->hiddenInput(); ?> <?php if (Yii::$app->user->isGuest) { ?> guest commenting <?php echo $form->field($model, 'authorid')->textInput(['placeholder' => Module::t('threads', 'Your e-mail')]); } ?> <?php echo $form->field($model, 'text')->textInput(['placeholder' => Module::t('threads', 'Text'), 'autocomplete' => 'off']); ?> <?php echo Html::submitButton(Module::t('threads', 'Send'), ['class' => 'btn btn-primary btn-block']); ?> <?php ActiveForm::end(); ?> <?php }
use yii\helpers\Html; use yii\widgets\DetailView; use simplator\threads\Module; /* @var $this yii\web\View */ /* @var $model simplator\threads\models\Comment */ $this->title = $model->id; $this->params['breadcrumbs'][] = ['label' => Module::t('threads', 'Comments'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="comment-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Module::t('threads', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Module::t('threads', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('threads', 'Are you sure you want to delete this item?'), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'module', 'itemid', 'time:datetime', 'text', 'authorid', 'authorname', 'status']]); ?> </div>
<?php use yii\helpers\Html; use simplator\threads\Module; /* @var $this yii\web\View */ /* @var $model simplator\threads\models\Comment */ $this->title = Module::t('threads', 'Update {modelClass}: ', ['modelClass' => 'Comment']) . ' ' . $model->id; $this->params['breadcrumbs'][] = ['label' => Module::t('threads', 'Comments'), 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]]; $this->params['breadcrumbs'][] = Module::t('threads', 'Update'); ?> <div class="comment-update"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo $this->render('_form', ['model' => $model]); ?> </div>
<?php use yii\helpers\Html; use yii\grid\GridView; use simplator\threads\Module; /* @var $this yii\web\View */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Module::t('threads', 'Comments'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="comment-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Module::t('threads', 'Create Comment'), ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'module', 'itemid', 'time:datetime', 'text', ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
echo $form->field($model, 'time')->textInput(); ?> <?php echo $form->field($model, 'text')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'authorid')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'authorname')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'status')->dropDownList(['show' => 'Show', 'spremod' => 'Spremod', 'premod' => 'Premod', 'hidden' => 'Hidden', 'blocked' => 'Blocked'], ['prompt' => '']); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Module::t('threads', 'Create') : Module::t('threads', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>