This method will generate the "name" and "value" tag attributes automatically for the model attribute
unless they are explicitly specified in $options.
public static activeHiddenInput ( |
||
$model | the model object | |
$attribute | string | the attribute name or expression. See [[getAttributeName()]] for the format about attribute expression. |
$options | array | the tag options in terms of name-value pairs. These will be rendered as the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]]. See [[renderTagAttributes()]] for details on how attributes are being rendered. |
return | string | the generated input tag |
echo $form->field($model, 'website')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'place_type')->dropDownList($model->getPlaceTypeOptions(), ['prompt' => 'What type of place is this?'])->label('Type of Place'); ?> <?php echo $form->field($model, 'notes')->textArea(); ?> <?php echo BaseHtml::activeHiddenInput($model, 'lat'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'lng'); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> </div> <!-- end col 1 --><div class="col-md-6"> <div id="preSearch" class="center"> <p><br /></p> <?php echo Html::a('Lookup Location', ['lookup'], ['class' => 'btn btn-success', 'onclick' => "javascript:beginSearch();return false;"]); ?> </div>
use yii\helpers\BaseHtml; $form = ActiveForm::begin(['id' => $model->formName()]); ?> <?php echo $form->field($model, 'CUST_KD')->textInput(['value' => $id, 'disabled' => true]); ?> <?php echo $form->field($model, 'ALAMAT')->textInput(['readonly' => true]); ?> <?php echo BaseHtml::activeHiddenInput($model, 'MAP_LAT'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'MAP_LNG'); ?> <?php echo \pigolab\locationpicker\LocationPickerWidget::widget(['options' => ['style' => 'width: 100%; height: 400px'], 'clientOptions' => ['location' => ['latitude' => -6.1783, 'longitude' => 106.6319], 'radius' => 300, 'inputBinding' => ['latitudeInput' => new JsExpression("\$('#customers-map_lat')"), 'longitudeInput' => new JsExpression("\$('#customers-map_lng')"), 'locationNameInput' => new JsExpression("\$('#customers-alamat')")]]]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'SAVE' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end();
echo BaseHtml::activeHiddenInput($model, 'name'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'google_place_id'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'location'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'website'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'vicinity'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'full_address'); ?> <?php echo $form->field($model, 'place_type')->dropDownList($model->getPlaceTypeOptions(), ['prompt' => 'What type of place is this?'])->label('Type of Place'); ?> <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 id="preSearch" class="center"> <p><br /></p> <?php echo Html::a('IN', ['lookup'], ['class' => 'btn btn-success', 'onclick' => "javascript:beginSearch();return false;"]); ?> </div> <?php echo BaseHtml::activeHiddenInput($model, 'LAT'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'LAG'); ?> <?php echo BaseHtml::activeHiddenInput($model, 'RADIUS'); ?> <div id="searchArea" class="hidden"> <div id="autolocateAlert"> </div> <!-- end autolocateAlert --> <p> your location...<span id="status"></span></p> <article> </article> <div class="form-actions hidden" id="actionBar"> </div> <!-- end action Bar--> </div> <!-- end searchArea --> </div> <!-- end col 2 -->