当前位置: 首页>>代码示例>>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;未经允许,请勿转载。