本文整理汇总了PHP中yii\bootstrap\Html::activeInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::activeInput方法的具体用法?PHP Html::activeInput怎么用?PHP Html::activeInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\Html
的用法示例。
在下文中一共展示了Html::activeInput方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderInput
/**
* @return string render input
*/
protected function renderInput()
{
$input = Html::dropDownList($this->name, $this->selected, $this->items, $this->options);
// If use form model then $input use active input
if ($this->hasModel()) {
$input = Html::activeDropDownList($this->model, $this->attribute . '[status]', $this->items, $this->options);
}
$input .= Html::beginTag('div', ['id' => 'status_payment', 'style' => 'margin-top: 20px;']);
foreach ($this->columns as $status => $item) {
$input .= Html::beginTag('div', ['class' => 'status_payment', 'id' => 'status_payment_' . $status, 'style' => 'display: none']);
foreach ($item as $name => $info) {
$placeholder = isset($info['placeholder']) ? $info['placeholder'] : null;
$value = isset($info['value']) ? $info['value'] : null;
$input .= Html::activeInput('text', $this->model, $this->attribute . '[infomation][' . $name . ']', ['placeholder' => $placeholder, 'class' => $this->options['columnClass'], 'readonly' => '', 'value' => $value, 'style' => 'margin-top: 20px;']);
}
$input .= Html::endTag('div');
}
$input .= Html::endTag('div');
return $input;
}
示例2:
<div class="col-lg-12">
<hr>
</div>
<div class="col-lg-4">
<?php
echo \Yii::t('app', 'SENSOR ADMIN MAIL');
?>
<br /><?php
echo \Yii::t('app', 'Who will be uploading data?');
?>
</div>
<div class="col-lg-8">
<?php
echo Html::activeInput('text', $model, 'admin_email');
?>
</div>
<div class="col-lg-12 text-center">
<?php
echo Html::errorSummary($model);
?>
<?php
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($model->isNewRecord ? \Yii::t('app', 'Create sensor') : \Yii::t('app', 'Save sensor')), ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-danger']);
?>
</div>
<div class="col-lg-12">
<br /><br /><br />
</div>
</div>
示例3:
<div class="input-group-btn">
<button type="button" class="btn btn-default iwd-label dropdown-toggle" data-toggle="dropdown">
<?php
echo StringHelper::getCurrencySymbol(Html::getAttributeValue($model, $currencyAttributeName));
?>
</button>
<button type=button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span> <span class="sr-only"><?php
echo Yii::t('hipanel', 'Toggle dropdown');
?>
</span>
</button>
<ul class="dropdown-menu">
<?php
foreach (ArrayHelper::remove($currencyAttributeOptions, 'items', []) as $k => $v) {
?>
<li>
<?php
echo Html::a(StringHelper::getCurrencySymbol($k), '#', ['data-value' => $k, 'data-label' => StringHelper::getCurrencySymbol($k)]);
?>
</li>
<?php
}
?>
</ul>
</div>
<?php
echo Html::activeInput('text', $model, $attribute, ['class' => 'form-control']);
?>
</div>
示例4:
?>
</div>
<div class="col-sm-12">
<hr>
</div>
<div class="col-sm-4">
<?php
echo \Yii::t('app', 'YOUR EMAIL');
?>
<br /><?php
echo \Yii::t('app', 'If the sensor admin has a question, he will contact you');
?>
</div>
<div class="col-sm-8">
<?php
echo Html::activeInput('text', $model, 'youremail');
?>
</div>
<div class="col-sm-12 text-center">
<?php
echo Html::errorSummary($model);
?>
<?php
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> Upload Data', ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-danger']);
?>
</div>
<div class="col-sm-12">
<br /><br /><br />
</div>