예제 #1
0
                    </div>
                </div>
                <?php 
echo $form->field($model, 'language')->dropDownList(Yii::$app->getLanguagesList(), ['prompt' => Yii::t('gromver.platform', 'Select ...'), 'id' => 'language']);
?>

                <?php 
echo $form->field($model, 'category_id')->widget(\kartik\widgets\DepDrop::className(), ['pluginOptions' => ['depends' => ['language'], 'placeholder' => Yii::t('gromver.platform', 'Select ...'), 'url' => \yii\helpers\Url::to(['categories', 'selected' => $model->category_id])]]);
?>

                <?php 
echo $form->field($model, 'status')->dropDownList(['' => Yii::t('gromver.platform', 'Select ...')] + $model->statusLabels());
?>

                <?php 
echo $form->field($model, 'published_at')->widget(\kartik\widgets\DateTimePicker::className(), ['options' => ['value' => date('d.m.Y H:i', is_int($model->published_at) ? $model->published_at : time())], 'pluginOptions' => ['format' => 'dd.mm.yyyy hh:ii', 'autoclose' => true]]);
?>
            </div>

            <div id="advanced-options" class="tab-pane">
                <?php 
echo $form->field($model, 'preview_text')->textarea(['rows' => 6]);
?>

                <?php 
echo $form->field($model, 'ordering')->textInput(['maxlength' => 11]);
?>

                <?php 
echo $form->field($model, 'tags')->widget(\dosamigos\selectize\Selectize::className(), ['options' => ['multiple' => true], 'items' => \yii\helpers\ArrayHelper::map($model->tags, 'id', 'title', 'group'), 'clientOptions' => ['maxItems' => 'NaN'], 'url' => ['/grom/tag/default/tag-list']]);
?>
예제 #2
0
 /**
  * @param \Yii\widgets\ActiveForm $form
  * @param array $options
  * @return \Yii\widgets\ActiveField|static
  */
 public function field($form, $options = [])
 {
     return parent::field($form, $options)->widget(DateTimePicker::className(), ['pluginOptions' => ['format' => $this->format], 'convertFormat' => true]);
 }
예제 #3
0
}
JS
, 'actionHandler' => 'function(url) {return (new URI(url)).addSearch("CategorySearch[language]", $("#' . $idLanguage . '").val())}']) . '</div>'])->widget(\kartik\select2\Select2::className(), ['initValueText' => $model->parent ? $model->parent->isRoot() ? Yii::t('gromver.platform', 'Top Level') : $model->parent->title : null, 'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'pluginOptions' => ['allowClear' => true, 'placeholder' => Yii::t('gromver.platform', 'Top Level'), 'ajax' => ['url' => \yii\helpers\Url::to(['category-list', 'exclude' => $model->isNewRecord ? null : $model->id]), 'data' => new \yii\web\JsExpression('function(params) { return {q:params.term, language:$("#' . $idLanguage . '").val()}; }')]]]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'status', ['wrapperOptions' => ['class' => 'col-sm-9']])->dropDownList($model->statusLabels());
?>
        </div>
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'published_at', ['wrapperOptions' => ['class' => 'col-sm-9']])->widget(\kartik\widgets\DateTimePicker::className(), ['options' => ['value' => Yii::$app->formatter->asDatetime(is_int($model->published_at) ? $model->published_at : time(), 'php:d.m.Y H:i')], 'pluginOptions' => ['format' => 'dd.mm.yyyy hh:ii', 'autoclose' => true]]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <?php 
$idTags = Html::getInputId($model, 'tags');
$handlerJs = <<<JS
function(data) {
    var select = \$("#{$idTags}").append('<option value="' + data.id + '">' + data.title + '</option>'),
        selectedValues = select.val() || [];
        selectedValues.push(data.id);

    select.val(\$.unique(selectedValues)).trigger('change');
/** @var \yii\web\View $title */
$this->title = Yii::t('app', 'Post edit');
$this->params['breadcrumbs'][] = ['url' => ['/admin-posts/index'], 'label' => Yii::t('app', 'Posts')];
?>

<div class="row">
    <div class="col-md-12">
        <div class="box">
            <?php 
$form = ActiveForm::begin(['id' => 'post-form', 'type' => ActiveForm::TYPE_HORIZONTAL, 'options' => ['enctype' => 'multipart/form-data']]);
?>
            <div class="box-body">
                <div class="row">
                    <div class="col-md-6 col-xs-12">
                        <?php 
echo $form->field($model, 'created_at')->widget(DateTimePicker::className(), ['type' => DateTimePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii', 'todayHighlight' => true]]);
?>
                    </div>
                    <div class="col-md-6 col-xs-12">
                        <?php 
if ($model->photo) {
    ?>
                            <div class="form-group">
                                <div><b><?php 
    echo Yii::t('app', 'Current photo');
    ?>
</b></div>
                                <?php 
    echo Html::img($model->getImageUrl('photo', 'mini'));
    ?>
                            </div>
예제 #5
0
파일: _form.php 프로젝트: riros/tests
<div class="card-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'sn')->textInput(['maxlength' => 255]);
?>

    <?php 
echo $form->field($model, 'creation_date')->widget(\kartik\widgets\DateTimePicker::className(), $params);
?>

    <?php 
echo $form->field($model, 'deactivation_date')->widget(\kartik\widgets\DateTimePicker::className(), $params);
?>

    <?php 
echo $form->field($model, 'sum')->textInput(['maxlength' => 20]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList([Card::StatusArray()]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
예제 #6
0
파일: _form.php 프로젝트: tqsq2005/Yii2adv
?>

<?php 
if ($this->context->module->settings['enableShort']) {
    ?>
    <?php 
    echo $form->field($model, 'short')->textarea();
}
?>

<?php 
echo $form->field($model, 'text')->widget(\kucha\ueditor\UEditor::className(), ['clientOptions' => ['initialFrameHeight' => '400', 'lang' => 'zh-cn']]);
?>

<?php 
echo $form->field($model, 'time')->widget(\kartik\widgets\DateTimePicker::className(), ['pluginOptions' => ['autoclose' => true]]);
?>

<?php 
if ($this->context->module->settings['enableTags']) {
    ?>
    <?php 
    echo $form->field($model, 'tagNames')->widget(TagsInput::className());
}
?>

<?php 
if (IS_ROOT) {
    ?>
    <?php 
    echo $form->field($model, 'slug');
예제 #7
0
<?php 
Modal::begin(['id' => 'modal-' . $suffix, 'header' => '<h4>' . $title . '</h4>', 'options' => ['aria-hidden' => 'true']]);
?>
<hr/>
<?php 
$formIdPrefix = 'form_';
$form_id = $formIdPrefix . $suffix;
$pjax_id = 'pjax-' . $suffix;
$pjax = Pjax::begin(['id' => $pjax_id, 'linkSelector' => '#' . 'submit-' . $suffix, 'formSelector' => "#{$form_id}"]);
$form = ActiveForm::begin(['action' => Url::toRoute($action), 'options' => ['anniversary_id' => $id, 'id' => $form_id], 'enableClientValidation' => false, 'enableAjaxValidation' => true]);
?>
<div class="row">
    <div class="col-md-12">
        <?php 
echo $form->field($model, $model->contentAttribute)->widget(DateTimePicker::className(), ['pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii:ss', 'todayHighlight' => true]]);
?>
    </div>
</div>
<div class="row">
    <div class="col-md-6">
        <div class="row">
            <div class="col-md-12">
                <?php 
echo $form->field($model, $model->contentTypeAttribute)->dropDownList($model->contentTypes);
?>
            </div>
        </div>
    </div>
    <div class="col-md-6">
        <div class="row">
예제 #8
0
?>

    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => '255']);
?>

    <?php 
echo $form->field($model, 'price', ['addon' => ['prepend' => ['content' => Yii::$app->formatter->currencyCode]]])->input('number');
?>

    <?php 
echo $form->field($model, 'description')->widget(Imperavi::className(), ['settings' => ['minHeight' => 200, 'plugins' => ['table', 'video', 'fontsize', 'fontfamily', 'fontcolor']]]);
?>

    <?php 
echo $form->field($model, 'date')->widget(DateTimePicker::className(), ['pluginOptions' => ['autoclose' => true, 'todayHighlight' => true, 'format' => 'yyyy-mm-dd hh:ii', 'todayBtn' => true, 'convertFormat' => true]]);
?>

    <?php 
echo $form->field($model, 'category_id')->dropDownList($categories);
?>

    <?php 
echo $form->field($model, 'status_id')->dropDownList($statuses);
?>

    <?php 
echo $form->field($model, 'slug')->textInput(['maxlength' => 255])->hint(Yii::t('backend/product', 'If empty it will be generated from name'));
?>

    <?php