當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Html::activeInput方法代碼示例

本文整理匯總了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;
 }
開發者ID:sya0710,項目名稱:yii2-payment,代碼行數:23,代碼來源:Payment.php

示例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>
開發者ID:ICHydro,項目名稱:anaconda,代碼行數:31,代碼來源:addsensor.php

示例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>
開發者ID:hiqdev,項目名稱:hipanel-core,代碼行數:30,代碼來源:AmountWithCurrency.php

示例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>  
開發者ID:ICHydro,項目名稱:anaconda,代碼行數:31,代碼來源:sensor_uploaddata.php


注:本文中的yii\bootstrap\Html::activeInput方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。