本文整理匯總了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>