function selectField($attribute, $data, $widgetOptions = [], $fieldOptions = []) { $defaultFieldOptions = ['options' => ['class' => 'form-group']]; $defaultInputOptions = ['class' => 'form-control select', 'placeholder' => $this->model->getAttributeLabel($attribute) . '...']; $fieldOptions = array_replace_recursive($defaultFieldOptions, $fieldOptions); $inputOptions = array_replace_recursive($defaultInputOptions, isset($widgetOptions['inputOptions']) ? $widgetOptions['inputOptions'] : []); if ($this->viewMode || in_array($attribute, $this->disabledFields)) { $fieldOptions['enableClientValidation'] = false; $inputOptions['disabled'] = 'disabled'; } $defaultWidgetOptions = ['data' => $data, 'options' => $inputOptions, 'pluginOptions' => ['allowClear' => true, 'minimumResultsForSearch' => 1]]; $widgetOptions = array_replace_recursive($defaultWidgetOptions, $widgetOptions); return $this->form->field($this->model, $attribute, $fieldOptions)->widget(Select2::classname(), $widgetOptions); }
if (yii::$app->has('organization') && ($organization = yii::$app->get('organization'))) { ?> <?php echo $form->field($model, 'organization_id')->dropDownList(array_merge(['0' => 'Нет'], ArrayHelper::map($organization->getList(), 'id', 'name'))); ?> <?php } ?> <?php echo $form->field($model, 'sort')->textInput(['maxlength' => true]); ?> <p><small>Чем выше приоритет, тем выше элемент среди других в общем списке.</small></p> <?php echo $form->field($model, 'service_ids')->widget(Select2::classname(), ['data' => $services, 'language' => 'ru', 'options' => ['multiple' => true, 'placeholder' => 'Выберите услуги комплекса ...'], 'pluginOptions' => ['allowClear' => true]]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Редактировать', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
/* @var $this yii\web\View */ /* @var $model backend\models\AuthItemChild */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="auth-item-child-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'parent')->widget(Select2::classname(), ['data' => ArrayHelper::map(AuthItem::find()->where(['and', "type=1"])->all(), 'name', 'name'), 'language' => 'en', 'options' => ['placeholder' => 'Please Select']]); ?> <?php echo $form->field($model, 'child')->widget(Select2::classname(), ['data' => ArrayHelper::map(AuthItem::find()->where(['and', "type=2"])->all(), 'name', 'name'), 'language' => 'en', 'options' => ['placeholder' => 'Please Select']]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
use backend\models\Companies; use kartik\select2\Select2; /* @var $this yii\web\View */ /* @var $model backend\models\Branches */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="branches-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'companies_company_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Companies::find()->all(), 'company_id', 'company_name'), 'language' => 'en', 'options' => ['placeholder' => 'Выберите компанию'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'branch_name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'branch_address')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'branch_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => '']); ?>
use yii\helpers\ArrayHelper; use yii\helpers\Html; use kartik\widgets\ActiveForm; use kartik\builder\Form; use kartik\select2\Select2; use kartik\datecontrol\DateControl; ?> <?php echo $form->field($model, 'edital')->textInput(['readonly' => true]); ?> <?php $data_cargos = ArrayHelper::map($cargos, 'descricao', 'descricao'); echo $form->field($model, 'cargo')->widget(Select2::classname(), ['data' => array_merge(["" => ""], $data_cargos), 'options' => ['placeholder' => 'Selecione o cargo...'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'nome')->textInput(['maxlength' => true, 'placeholder' => 'Nome completo...']); ?> <?php echo $form->field($model, "datanascimento")->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATETIME, 'displayFormat' => 'dd/MM/yyyy', 'autoWidget' => false, 'widgetClass' => 'yii\\widgets\\MaskedInput', 'options' => ['mask' => '99/99/9999', 'options' => ['class' => 'form-control', 'placeholder' => 'Data nascimento...']]]); ?> <?php echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 4, 'attributes' => ['cpf' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe seu CPF...']], 'identidade' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe seu RG...']], 'orgao_exped' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe o orgão expedidor...']], 'sexo' => ['type' => Form::INPUT_RADIO_LIST, 'items' => [true => 'Masculino', false => 'Feminino'], 'options' => ['inline' => true]]]]); ?>
}).done(function(data) { callback(data.results);}); } } SCRIPT; $met_description = Yii::t('app', 'Introduce your business, Your business on the map, image gallery for your business, attachments for your business, Mark your business location in map'); $this->registerMetaTag(['property' => 'og:description', 'content' => $met_description]); $this->registerMetaTag(['name' => 'description', 'content' => $met_description]); $this->registerMetaTag(['name' => 'keywords', 'content' => $met_description]); ?> <div class="row"> <div class="col-md-2"> <?php $form = ActiveForm::begin(['id' => $searchModel->formName(), 'enableAjaxValidation' => false, 'enableClientValidation' => false, 'method' => 'get']); ?> <?php echo $form->field($searchModel, 'category_id')->widget(Select2::classname(), ['language' => Yii::$app->helper->getTwoCharLanguage(), 'size' => Select2::MEDIUM, 'options' => [], 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 2, 'ajax' => ['url' => $categoriesListUrl, 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {search:params.term}; }'), 'results' => new JsExpression('function(data,page) { return {results:data.results}; }')], 'initSelection' => new JsExpression($initCategoriesListScript)]]); ?> <?php echo $form->field($searchModel, 'country_id')->widget(Select2::className(), ['data' => ArrayHelper::map(Country::find()->asArray()->all(), 'id', 'name'), 'language' => Yii::$app->helper->getTwoCharLanguage(), 'options' => ['placeholder' => Yii::t('app', 'Select...')], 'pluginOptions' => ['allowClear' => true]]); echo $form->field($searchModel, 'province_id')->widget(DepDrop::classname(), ['data' => !$searchModel->country_id ? [] : ArrayHelper::map(Province::find()->where(['country_id' => $searchModel->country_id])->asArray()->all(), 'id', 'name'), 'type' => DepDrop::TYPE_SELECT2, 'options' => ['placeholder' => Yii::t('app', 'Select...')], 'select2Options' => ['pluginOptions' => ['allowClear' => true], 'language' => Yii::$app->helper->getTwoCharLanguage()], 'pluginOptions' => ['depends' => ['search-country_id'], 'url' => Url::to(['/province/dep-list']), 'loadingText' => Yii::t('app', 'Loading...')]]); echo $form->field($searchModel, 'city_id')->widget(DepDrop::classname(), ['data' => !$searchModel->province_id ? [] : ArrayHelper::map(City::find()->where(['province_id' => $searchModel->province_id])->asArray()->all(), 'id', 'name'), 'options' => ['placeholder' => Yii::t('app', 'Select...')], 'type' => DepDrop::TYPE_SELECT2, 'select2Options' => ['pluginOptions' => ['allowClear' => true], 'language' => Yii::$app->helper->getTwoCharLanguage()], 'pluginOptions' => ['depends' => ['search-province_id'], 'url' => Url::to(['/city/dep-list']), 'loadingText' => Yii::t('app', 'Loading...')]]); ?> <?php echo $form->field($searchModel, 'title')->textInput(); ?> <?php echo $form->field($searchModel, 'address')->textInput(); ?> <?php echo Html::hiddenInput('view', $adverView, ['id' => 'hiddenViewMode']); ?>
echo $form->errorSummary($model); ?> <!-- dummy inputs to prevent auto fill --> <input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" /> <input type="password" name="password_fake" id="password_fake" value="" style="display:none;" /> <div class="row"> <div class="col-md-8"> <?php echo $form->field($model, 'username')->textInput(['maxlength' => 128, 'autocomplete' => 'new_username']); if (in_array(Module::SCN_ADMIN, $m->passwordSettings['strengthMeter'])) { echo $form->field($model, 'password')->widget(PasswordInput::classname(), []); } else { echo $form->field($model, 'password')->passwordInput(); } echo $form->field($model, 'email')->textInput(['maxlength' => 255]); echo $form->field($model, 'status')->widget(Select2::classname(), ['data' => $m->getEditStatuses(), 'options' => ['options' => $m->getDisabledStatuses()]]); ?> </div> </div> <hr> <div class="text-right"> <?php echo $m->button(Module::BTN_RESET_FORM); ?> <?php echo $m->button(Module::BTN_SUBMIT_FORM); ?> </div> <?php ActiveForm::end();
?> <div class="row"> <div class="col-lg-5 col-centered"> <?php echo $form->field($model, 'name'); ?> <?php echo $form->field($model, 'description')->textarea(); ?> <?php echo $form->field($model, 'cover'); ?> <?php echo $form->field($model, 'file'); ?> <?php echo $form->field($model, 'categories')->widget(Select2::classname(), ['options' => ['placeholder' => null, 'multiple' => true], 'data' => $model->getCategoriesData(), 'pluginOptions' => ['tags' => true, 'maximumInputLength' => 10, 'ajax' => ['url' => Url::to(['/ajax/category/index']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(data) { return data.text; }'), 'templateSelection' => new JsExpression('function (data) {return data.text;}')]]); ?> <?php echo $form->field($model, 'users')->widget(Select2::classname(), ['options' => ['placeholder' => null, 'multiple' => true], 'data' => $model->getUsersData(), 'pluginOptions' => ['tags' => true, 'maximumInputLength' => 10, 'ajax' => ['url' => Url::to(['/ajax/user/index']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(data) { return data.text; }'), 'templateSelection' => new JsExpression('function (data) { return data.text; }')]]); ?> <div class="form-group"> <?php echo Html::submitButton('Сохранить', ['class' => 'btn btn-primary', 'name' => 'button-save']); ?> </div> </div> </div> <?php ActiveForm::end();
<div class="container"> <div class="section-inner"> <div class="section-content layout-2cols-left"> <div class="row"> <div class="col-xs-12 col-sm-9 col-sm-push-3 col-main section-gap"> <div class="reg-area"> <h1 class="text-center h2">Create New Message</h1> <?php $form = ActiveForm::begin(['id' => 'formDefault', 'layout' => 'horizontal', 'options' => ['enctype' => 'multipart/form-data'], 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-sm-2', 'wrapper' => 'col-sm-10', 'error' => 'help-block m-b-none', 'hint' => '']]]); ?> <?php echo $form->field($model, 'subject'); ?> <?php echo $form->field($model, 'users')->widget(\kartik\select2\Select2::classname(), ['data' => $model->getUserOptions(), 'options' => ['placeholder' => Yii::t('message', 'Select Users'), 'multiple' => 'multiple'], 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 2, 'ajax' => ['url' => Url::to(['user-list']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(users) { return users.text; }'), 'templateSelection' => new JsExpression('function (users) { return users.text; }')]]); ?> <?php echo $form->field($model, 'category_id')->dropDownList(\app\modules\message\models\Message::getCategoryOptions()); ?> <?php echo $form->field($model, 'content')->widget(letyii\tinymce\Tinymce::className(), ['options' => ['style' => 'height: 400px;'], 'configs' => ['setup' => new \yii\web\JsExpression('function(editor) { editor.on("change", function() { tinymce.triggerSave(); }); }'), 'plugins' => 'moxiemanager advlist autolink lists link image charmap print preview hr anchor pagebreak ' . 'searchreplace wordcount visualblocks visualchars code fullscreen ' . 'insertdatetime media nonbreaking save table contextmenu directionality ' . 'emoticons template paste textcolor colorpicker textpattern', 'toolbar1' => 'insertfile undo redo | styleselect | fontselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', 'toolbar2' => 'print preview media | forecolor backcolor emoticons', 'moxiemanager_image_settings' => ['moxiemanager_title' => 'Images', 'moxiemanager_extensions' => 'jpg,png,gif', 'moxiemanager_rootpath' => '/uploads/files', 'moxiemanager_view' => 'thumbs'], 'external_plugins' => ['moxiemanager' => Url::base() . '/plugins/moxiemanager/plugin.min.js']]]); ?> <div class="text-center"> <button type="submit" class="button button-primary button-lg">Send</button> </div> <?php ActiveForm::end(); ?>
<div class="col-sm-9"> <?php echo $this->render('/elements/messages/_navbar', ['active' => 'new']); ?> <br> <?php $form = ActiveForm::begin(['id' => 'message-form']); ?> <div class="row"> <div class="col-sm-3 text-right"><p class="form-control-static"><?php echo Yii::t('podium/view', 'Send to'); ?> </p></div> <div class="col-sm-9"> <?php echo $form->field($model, 'receiver_id')->widget(Select2::classname(), ['options' => ['placeholder' => Yii::t('podium/view', 'Select a member...')], 'theme' => Select2::THEME_KRAJEE, 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 3, 'ajax' => ['url' => Url::to(['members/fieldlist']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }')]])->label(false); ?> </div> </div> <div class="row"> <div class="col-sm-3 text-right"><p class="form-control-static"><?php echo Yii::t('podium/view', 'Message Topic'); ?> </p></div> <div class="col-sm-9"> <?php echo $form->field($model, 'topic')->textInput(['placeholder' => Yii::t('podium/view', 'Message Topic')])->label(false); ?> </div> </div> <div class="row">
use yii\helpers\ArrayHelper; use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model im\eav\models\Value */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="value-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'attribute_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Attribute::find()->asArray()->orderBy('name')->all(), 'id', 'presentation'), 'options' => ['prompt' => '']]); ?> <?php echo $form->field($model, 'value')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'presentation')->textInput(['maxlength' => true]); ?> <?php echo Html::submitButton($model->isNewRecord ? Module::t('module', 'Create') : Module::t('module', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-success']); ?> <?php
<div class="panel panel-default"> <?php $form = ActiveForm::begin(['id' => 'details-form']); ?> <div class="panel-body"> <div class="row"> <div class="col-sm-12"> <?php echo $form->field($model, 'username')->textInput(['data-container' => 'body', 'data-toggle' => 'popover', 'data-placement' => 'right', 'data-content' => Yii::t('podium/view', 'Username must start with a letter, contain only letters, digits and underscores, and be at least 3 characters long.'), 'data-trigger' => 'focus'])->label(Yii::t('podium/view', 'Username')); ?> </div> </div> <div class="row"> <div class="col-sm-12"> <?php echo $form->field($model, 'timezone')->widget(Select2::classname(), ['data' => Helper::timeZones(), 'theme' => Select2::THEME_KRAJEE, 'options' => ['placeholder' => Yii::t('podium/view', 'Select your time zone for proper dates display...')], 'pluginOptions' => ['allowClear' => true]])->label(Yii::t('podium/view', 'Time Zone')); ?> </div> </div> <div class="row"> <div class="col-sm-12"> <?php echo $form->field($model, 'anonymous')->checkbox(['uncheck' => 0])->label(Yii::t('podium/view', 'Hide username while forum viewing')); ?> </div> </div> <div class="row"> <div class="col-sm-12"> <button class="btn btn-success" id="show-email"><span class="glyphicon glyphicon-envelope"></span> <?php echo Yii::t('podium/view', 'Click here to change your e-mail address'); ?>
<?php /* $form->field($model, 'username')->textInput(['maxlength' => true]) */ ?> <?php // $form->field($model, 'datetime')->textInput() ?> <?php // $form->field($model, 'ipaddress')->textInput() ?> <?php echo $form->field($model, 'degreeid')->widget(Select2::classname(), ['name' => 'state_2', 'value' => '', 'data' => ArrayHelper::map(Acddegree::find()->joinWith(['acdevaluations.group'])->where(['acdgroup.groupid' => $model->groupid])->orderBy('description')->asArray()->all(), 'degreeid', 'description'), 'id' => 'combo', 'pluginOptions' => ['allowClear' => true], 'options' => ['placeholder' => 'Selecione o Grau acadêmico', 'format' => 'raw']]); ?> <?php echo $form->field($model, 'description')->textInput(); ?> <?php // $form->field($model, 'dateforecast')->textInput() ?> <?php echo $form->field($model, 'dateforecast')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'ajaxConversion' => false, 'options' => ['pluginOptions' => ['autoclose' => true]]]); ?> <?php //$form->field($model, 'weight')->textInput()
foreach ($rces as $i => $rce) { $ids[$i] = $rce->reserva_id; } $data = ArrayHelper::map(Reserva::find()->where(['not in', 'id', $ids])->all(), 'id', 'ReservaSelect'); ?> <?php echo $form->field($model, "reserva_id")->widget(Select2::classname(), ['data' => $data, 'options' => ['placeholder' => 'Seleccionar Reserva...', 'id' => 'reservaId'], 'pluginOptions' => ['width' => '300px', 'disabled' => !$model->isNewRecord]]); ?> <?php $data = ArrayHelper::map(Profesional::find()->all(), 'id', 'Nombres'); ?> <?php echo $form->field($model, "persona_id_realiza_examen")->widget(Select2::classname(), ['data' => $data, 'options' => ['placeholder' => 'Seleccionar Profesional que realiza el Examen...'], 'pluginOptions' => ['width' => '300px', 'disabled' => !$model->isNewRecord]]); ?> <?php foreach ($modelsExamenes as $i => $modelExamen) { $script = <<<JS // here you right all your javascript stuff \$('#reservaId').change(function(){ var reservaId = \$(this).val(); \$.get('index.php?r=examen/get-datos-examen',{ reservaId : reservaId },function(data){ var data = \$.parseJSON(data); \$('#rceexamenexamen-{$i}-monto_a_pagar').attr('value',data[{$i}].monto); \$('#rceexamenexamen-{$i}-descripcion').attr('value',data[{$i}].descripcion); \$('#rceexamenexamen-{$i}-observaciones').attr('value',data[{$i}].observaciones); });
use kartik\select2\Select2; use yii\helpers\ArrayHelper; use common\models\Scholar; /* @var $this yii\web\View */ /* @var $model common\models\Tuition */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="tuition-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'scholar_scholar_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Scholar::find()->all(), 'scholar_id', 'scholar_last_name', 'scholar_id'), 'language' => 'en', 'options' => ['placeholder' => 'Select Scholar ID'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'tuition_term')->textInput(); ?> <?php echo $form->field($model, 'tuition_school_year_start')->textInput(); ?> <?php echo $form->field($model, 'tuition_school_year_end')->textInput(); ?> <?php
echo $form->field($model, 'phone')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'email')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'gambar')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png']]]); ?> <!--$form->field($model, 'image')->fileInput() ?>--> <?php echo $form->field($model, 'itemType')->widget(Select2::classname(), ['data' => $datastatik, 'options' => ['placeholder' => 'pilih ...'], 'pluginOptions' => ['allowClear' => true]]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
Тип визита </th> <td> <?php echo $form->field($model, 'visit_type')->radioList([Records::CASH => 'Наличные', Records::INSURER => 'Страховая компания'])->label(FALSE); ?> </td> </tr> <tr> <th> Страховая компания </th> <td> <?php $list = ArrayHelper::map(Insurers::find()->orderBy('name')->all(), 'id', 'name'); echo $form->field($model, 'insurer_id')->widget(Select2::classname(), ['data' => $list, 'language' => 'ru', 'options' => ['placeholder' => 'Выберите страховщика ...'], 'pluginOptions' => ['allowClear' => true]])->label(FALSE); ?> </td> </tr> </table> <div class="form-group"> <?php echo Html::submitButton('Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
echo $form->field($model, 'tumbon')->widget(DepDrop::className(), ['data' => $tum, 'options' => ['placeholder' => '<--คลิกเลือกตำบล-->'], 'type' => DepDrop::TYPE_SELECT2, 'select2Options' => ['pluginOptions' => ['allowClear' => true]], 'pluginOptions' => ['depends' => ['employees-chw', 'employees-ampur'], 'url' => yii\helpers\Url::to(['/employees/get-dist']), 'loadingText' => 'กำลังค้นข้อมูล...']]); ?> </div> <div class="col-xs-3 col-sm-3 col-md-3"> <?php echo $form->field($model, 'tel')->widget(\yii\widgets\MaskedInput::classname(), ['mask' => '999-999-9999']); ?> </div> <div class="col-xs-3 col-sm-3 col-md-3"> <?php echo $form->field($model, 'comein')->widget(DatePicker::className(), ['language' => 'th', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'changeYear' => true], 'options' => ['class' => 'form-control']]); ?> </div> <div class="col-xs-3 col-sm-3 col-md-3"> <?php echo $form->field($model, 'department_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Departments::find()->all(), 'id', 'name'), 'language' => 'th', 'options' => ['placeholder' => 'เลือกแผนก ...'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-xs-3 col-sm-3 col-md-3"> <?php echo $form->field($model, 'education')->dropDownList(['ปริณญาตรี' => 'ปริณญาตรี', 'ปริณญาโท' => 'ปริณญาโท', 'สูงกว่าระดับปริณญาโทขึ้นไป' => 'สูงกว่าระดับปริณญาโทขึ้นไป', 'ปวส/อนุปริณญา' => 'ปวส/อนุปริณญา', 'มัธยมศึกษา6' => 'มัธยมศึกษา6', 'มัธยมศึกษา3' => 'มัธยมศึกษา3', 'ประถมศึกษา' => 'ประถมศึกษา'], ['prompt' => '']); ?> </div> </div> <div class="row"> <div class="col-xs-6 col-sm-6col-md-6"> <?php echo $form->field($model, 'ability')->checkboxList(app\models\Employees::itemAlias('ability')); ?> </div> </div>
<div class="row"> <div class="col-sm-6"> <?php echo $form->field($user, 'newPassword')->passwordInput(['placeholder' => Yii::t('app', 'Enter password...')])->label($user->isNewRecord ? Yii::t('app', 'Password') : Yii::t('app', 'Change Password')); ?> </div> <div class="col-sm-6"> <?php echo $form->field($user, 'status')->dropDownList($user::statusDropdown()); ?> </div> </div> <div class="row"> <div class="col-sm-6"> <?php echo $form->field($user, 'role_id')->widget(Select2::classname(), ['data' => array_reverse($role::dropdown(), true), 'hideSearch' => true, 'pluginEvents' => ["select2:select" => "function(e) {\n if( e.params.data.id == '2' ) {\n \$('#formList').show();\n } else {\n \$('#formList').hide();\n }\n }"]])->label(Yii::t('app', 'Role')); ?> </div> <div class="col-sm-6" id="formList"> <?php echo Html::label(Yii::t('app', 'Grant Access')); ?> <?php echo Select2::widget(['name' => 'forms', 'data' => $forms, 'value' => isset($userForms) ? $userForms : null, 'options' => ['placeholder' => Yii::t('app', 'Select forms...'), 'multiple' => true], 'pluginOptions' => ['allowClear' => true]]); ?> <p class="help-block"><?php echo Yii::t('app', 'By default, users have no access.'); ?> </p> </div> </div>
echo $form->field($model, 'id')->textInput(['disabled' => 'disabled', 'placeholder' => 'autonumber']); ?> <?php echo $form->field($model, 'number')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'city_id')->widget(DepDrop::classname(), ['data' => [], 'type' => DepDrop::TYPE_SELECT2, 'select2Options' => ['pluginOptions' => ['multiple' => FALSE, 'allowClear' => TRUE, 'tags' => TRUE, 'maximumInputLength' => 255]], 'pluginOptions' => ['initialize' => TRUE, 'placeholder' => 'Select or type city', 'depends' => ['rgndistrictform-province_id'], 'url' => Url::to(['/rgn-city/depdrop-options', 'selected' => $model->city_id]), 'loadingText' => 'Loading cities ...']]); ?> <?php echo $form->field($model, 'province_id')->widget(DepDrop::classname(), ['data' => [], 'type' => DepDrop::TYPE_SELECT2, 'select2Options' => ['pluginOptions' => ['multiple' => FALSE, 'allowClear' => TRUE, 'tags' => TRUE, 'maximumInputLength' => 255]], 'pluginOptions' => ['initialize' => TRUE, 'placeholder' => 'Select or type province', 'depends' => ['rgndistrictform-country_id'], 'url' => Url::to(['/rgn-province/depdrop-options', 'selected' => $model->province_id]), 'loadingText' => 'Loading provinces ...']]); ?> <?php echo $form->field($model, 'country_id')->widget(Select2::classname(), ['data' => RgnCountry::asOption(), 'pluginOptions' => ['placeholder' => 'Select or type Country', 'multiple' => FALSE, 'allowClear' => TRUE, 'tags' => TRUE, 'maximumInputLength' => 255]]); ?> </p> <?php $this->endBlock(); ?> <?php echo Tabs::widget(['encodeLabels' => false, 'items' => [['label' => 'RgnDistrict', 'content' => $this->blocks['main'], 'active' => true]]]); ?> <hr/> <?php echo $form->errorSummary($model); ?> <?php
public static function getFormAttribs() { return ['id' => ['type' => TabularForm::INPUT_HIDDEN, 'columnOptions' => ['hidden' => true]], 'cat_title' => ['type' => TabularForm::INPUT_WIDGET, 'widgetClass' => \kartik\select2\Select2::classname(), 'options' => ['data' => ArrayHelper::map(Page::find()->asArray()->all(), 'id', 'page_title')]], 'cat_desc' => ['type' => TabularForm::INPUT_TEXT]]; }
echo $form->field($model, 'liceoCurso')->textInput(['maxlength' => true]); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'correo')->textInput(['maxlength' => true]); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'direccion')->textInput(['maxlength' => true]); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'comunas_comuna_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Comunas::find()->all(), 'comuna_id', 'comuna_nombre'), 'language' => 'en', 'hideSearch' => false, 'options' => ['placeholder' => 'Seleccione su comuna'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'telefono')->textInput(['maxlength' => true]); ?> </div> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>
?> <?php echo $form->field($model, 'object_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(\common\models\CsObjects::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'Izaberite...'], 'language' => 'sr-Latn', 'changeOnReset' => false]); ?> <?php echo $form->field($model, 'property_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(\common\models\CsProperties::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'Izaberite...'], 'language' => 'sr-Latn', 'changeOnReset' => false]); ?> <?php echo $form->field($model, 'property_unit_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(\common\models\CsUnits::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'Izaberite...'], 'language' => 'sr-Latn', 'changeOnReset' => false]); ?> <?php echo $form->field($model, 'property_unit_imperial_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(\common\models\CsUnits::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'Izaberite...'], 'language' => 'sr-Latn', 'changeOnReset' => false]); ?> <?php echo $form->field($model, 'property_class')->dropDownList(['public' => 'Public', 'private' => 'Private', 'protected' => 'Protected'], ['prompt' => '']); ?> <?php echo $form->field($model, 'property_type')->dropDownList(['general' => 'General', 'product' => 'Product', 'model' => 'Model', 'part' => 'Part', 'empty' => 'Empty'], ['prompt' => '']); ?> <?php echo $form->field($model, 'input_type')->dropDownList(['1' => 'number', '2' => 'radio', '21' => 'radioButton', '22' => 'radio', '23' => 'radioButton', '3' => 'select', '31' => 'select2', '32' => 'select_media', '4' => 'multiselect', '41' => 'checkboxButton', '42' => 'multiselect_select', '43' => 'multiselect_select2', '44' => 'multiselect_media', '5' => 'checkbox', '6' => 'text', '7' => 'textarea', '8' => 'slider', '9' => 'range', '10' => 'date', '11' => 'time', '12' => 'datetime', '13' => 'email', '14' => 'url', '15' => 'color', '16' => 'date range'], ['prompt' => '']); ?> <?php
<div class="row"> <div class="col-lg-6 col-xs-6"> <?php echo $form->field($model, 'category_id')->widget(Select2::classname(), ['data' => Category::buildTextTree(), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите категорию ...'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'producer_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Producer::find()->all(), 'id', 'name'), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите бренд ...'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-lg-6 col-xs-6"> <?php echo $form->field($model, 'category_ids')->label('Прочие категории')->widget(Select2::classname(), ['data' => Category::buildTextTree(), 'language' => 'ru', 'options' => ['multiple' => true, 'placeholder' => 'Доп. категории ...'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> </div> <?php echo $form->field($model, 'text')->widget(\yii\imperavi\Widget::className(), ['plugins' => ['fullscreen', 'fontcolor', 'video'], 'options' => ['minHeight' => 400, 'maxHeight' => 400, 'buttonSource' => true, 'imageUpload' => Url::toRoute(['tools/upload-imperavi'])]]); ?> <?php echo $form->field($model, 'short_text')->textInput(['maxlength' => true]); ?> <?php echo Gallery::widget(['model' => $model]); ?>
/* @var $model backend\models\Customers */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="customers-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'customer_name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'zip_code')->widget(Select2::classname(), ['data' => ArrayHelper::map(Locations::find()->all(), 'location_id', 'zip_code'), 'language' => 'en', 'options' => ['placeholder' => 'Выберите zip_code', 'id' => 'zipCode'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'city')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'province')->textInput(['maxlength' => true]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>
$fields[] = $form->field($model, 'price')->textInput(['maxlength' => 10]); $fields[] = $form->field($model, 'stock_qty')->textInput(); $fields[] = $form->field($model, 'min_sale_qty')->textInput(); $fields[] = $form->field($model, 'max_sale_qty')->textInput(); $fields[] = $form->field($model, 'weight')->textInput(['maxlength' => 10]); $fields[] = $form->field($model, 'shipping_fee')->textInput(['maxlength' => 10]); $fields[] = $form->field($model, 'is_free_shipping')->checkbox(); $fieldGroups[] = ['label' => 'Price & Stock', 'content' => implode('', $fields)]; $fields = []; $fields[] = $form->field($model, 'pictures')->widget(InputFile::className(), ['multiple' => true, 'template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default']]); $categories = \kiwi\Kiwi::getCategory()->find()->all(); $categories = ArrayHelper::map($categories, 'id', 'name'); $fields[] = $form->field($model, 'categoryIds')->widget(Select2::classname(), ['data' => $categories, 'language' => 'en', 'options' => ['placeholder' => 'Select a state ...'], 'options' => ['multiple' => true]]); $tags = \kiwi\Kiwi::getTag()->find()->all(); $tags = ArrayHelper::map($tags, 'id', 'name'); $fields[] = $form->field($model, 'tagIds')->widget(Select2::classname(), ['data' => $tags, 'language' => 'en', 'options' => ['placeholder' => 'Select a state ...'], 'options' => ['multiple' => true]]); $fieldGroups[] = ['label' => 'Picture & Category & Tag', 'content' => implode('', $fields)]; echo Tabs::widget(['items' => $fieldGroups]); ?> <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> <?php ActiveForm::end(); ?> </div>
use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model im\search\models\FacetSet */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="index-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'facets')->widget(Select2::classname(), ['data' => ArrayHelper::map(Facet::find()->asArray()->orderBy('name')->all(), 'id', 'name'), 'options' => ['multiple' => true]]); ?> <?php echo Html::submitButton($model->isNewRecord ? Module::t('module', 'Create') : Module::t('module', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-success']); ?> <?php ActiveForm::end(); ?> </div>
<label for="inputPermit">Permission</label> <div class="row"> <div class="col-lg-2"> <select id="inputPermit" class="form-control" name="PostEditForm[permit][]"> <option value="1">private</option> <option value="2">protected 1</option> <option value="3">protected 2</option> <option value="4">public</option> </select> </div> </div> </div> <div class="postReader" style="display: none"> <?php echo $form->field($model, 'reader[]')->widget(Select2::classname(), ['data' => $arrUserName, 'language' => 'en', 'options' => ['multiple' => true, 'placeholder' => 'Who read?'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="form-group" style="margin-top:30px"> <?php echo Html::submitButton('Save', ['class' => 'btn btn-success']); ?> </div> <?php ActiveForm::end(); ?> </div><!-- /.box-body --> </div> </div>
<div id="dscAudiencia" class="col-lg-4" style="display:none"> <?php echo $form->field($model, 'dsc_audiencia')->textInput(['maxlength' => true]); ?> </div> <div id="nmProcesso" class="col-lg-4" style="display:none"> <?php echo $form->field($model, 'nm_processo')->textInput(['maxlength' => true]); ?> </div> <div class="col-lg-4"> <?php echo $form->field($model, 'id_juiz')->label('Informe o nome ou CPF do juiz')->widget(Select2::classname(), ['language' => 'pt', 'pluginOptions' => ['allowClear' => false, 'size' => Select2::LARGE, 'minimumInputLength' => 3, 'ajax' => ['url' => Url::to(['juiz/lista']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(juiz) { return juiz.num_cpf != \'\' ? juiz.dsc_nome +" - "+juiz.num_cpf : juiz.dsc_nome }'), 'templateResult' => new JsExpression('formataCampo'), 'templateSelection' => new JsExpression('function (juiz) { return juiz.dsc_nome; }'), 'select2:selecting' => new JsExpression("function() { console.log('selecting'); }")]]); echo Html::a('Adicionar Juiz', '#', ['data-toggle' => 'modal', 'data-target' => '#modalJuiz']); ?> </div> <div class="col-lg-4"> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Cadastrar' : 'Atualizar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> </div> <?php ActiveForm::end();
use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model common\models\Topic */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="topic-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'node_id')->widget(\kartik\select2\Select2::classname(), ['data' => \yii\helpers\ArrayHelper::map(\common\models\Node::find()->all(), 'id', 'name'), 'options' => ['placeholder' => '节点'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'need_login')->dropDownList(['1' => '是', '0' => '否']); ?> <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> <?php ActiveForm::end(); ?>