当前位置: 首页>>代码示例>>PHP>>正文


PHP Html::buttonInput方法代码示例

本文整理汇总了PHP中yii\helpers\Html::buttonInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::buttonInput方法的具体用法?PHP Html::buttonInput怎么用?PHP Html::buttonInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\helpers\Html的用法示例。


在下文中一共展示了Html::buttonInput方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

            <div class="col-lg-7">
            	<div id="panelMinhaAnotacao" class="panel panel-default">
            		<div class="panel-heading">
            			<h3 class="panel-title"><i class="glyphicon glyphicon-list"></i> Minhas Anotações</h3>
            		</div>
            		<div class="panel-body">
            			<div id="campoMinhaAnotacao">
            				<div class="form-group">
            					<span id="tempoMinhaAnotacaoBadge" class="badge" style="margin-bottom:10px"></span>
		            			<?php 
echo yii\helpers\Html::textarea('anotacao', '', array('id' => 'textoMinhaAnotacao', 'rows' => 2, 'cols' => 71, 'class' => 'form-control', 'onkeyup' => 'ativaBtSalvar(this)'));
?>
	            				<br>
	            				<?php 
$url = Url::to(array('anotacao/salvar'));
echo yii\helpers\Html::buttonInput('Salvar', array('id' => 'btSalvarMinhaAnotacao', 'class' => 'btn btn-default', 'disabled' => true, 'onclick' => 'salvarAnotacao("' . $url . '")'));
?>
            				</div>
            			</div>
    					<ul id="listaMinhaAnotacao" class="list-group">
    						<?php 
if ($arrMinhaAnotacao) {
    foreach ($arrMinhaAnotacao as $minhaAnotacao) {
        $li = Html::tag('li', $minhaAnotacao->dsc_anotacao . Html::tag('span', $minhaAnotacao->num_segundo . 's', ['class' => 'badge']), ['class' => 'list-group-item']);
        echo Html::tag('a', $li, ['onclick' => 'goTo(' . $minhaAnotacao->num_segundo . ')']);
    }
}
?>
    						<a onclick="goTo(36)"><li class="list-group-item">fim gravacao<span class="badge">36s</span></li></a>
    					</ul>
  					</div>
开发者ID:ulissesvaquero,项目名称:audienciadigital,代码行数:31,代码来源:ver.php

示例2: field

    private static function field($key, $value, $sModel, $model)
    {
        if (strpos($sModel, "listT(") === 0) {
            $modelName = str_replace("listT(", "", $sModel);
            $modelName = str_replace(")", "", $modelName);
            $type = substr($modelName, strpos($modelName, '[') + 1, strpos($modelName, '[') - strpos($modelName, ']') + 1);
            //echo $type;
            //exit;
            $modelName = str_replace("[" . $type . "]", "", $modelName);
            $temp = ArrayHelper::map($modelName::findAllByType($type), 'id', 'name');
            $temp[''] = Yii::t('app', 'None');
            //$label = Yii::t('app', $sModel->id) ;
            $field = Html::dropDownList($model . '[' . $key . '][value]', $value, $temp) . "<br/>";
        } elseif (strpos($sModel, "list(") === 0) {
            $modelName = str_replace("list(", "", $sModel);
            $modelName = str_replace(")", "", $modelName);
            $temp = ArrayHelper::map($modelName::find()->All(), 'id', 'name');
            $temp[''] = Yii::t('app', 'None');
            //$label = Yii::t('app', $sModel->id) ;
            $field = \kartik\select2\Select2::widget(["name" => $model . '[' . $key . '][value]', "data" => $temp, "value" => $value]);
        } elseif (strpos($sModel, "select(") === 0) {
            $list = str_replace("select(", "", $sModel);
            //echo str_replace(")", "", $list);
            //exit;
            $list = Json::decode(str_replace(")", "", $list));
            foreach ($list as &$item) {
                //print $item;
                $item = Yii::t('app', $item);
            }
            //$temp = Html::listData(\yii\helpers\Json::decode($list), 'id', 'name');
            $temp[''] = Yii::t('app', 'None');
            //$label = Yii::t('app', $sModel->id);
            $field = \kartik\select2\Select2::widget(["name" => $model . '[' . $key . '][value]', "data" => $list, "value" => $value]);
        } elseif ($sModel == 'file') {
            $rKey = str_replace(".", "", $key);
            //$label = Yii::t('app', $sModel->id) ;
            $field = "<div class='row'><div class='btn-group '>" . Html::fileInput($model . '[' . $key . '][value]', $value, ['style' => 'display:none;', 'id' => $model . "_" . $rKey . "_input", "accept" => "image/gif,image/jpeg"]) . Html::hiddenInput($model . '[' . $key . '][value]', $value) . Html::buttonInput(Yii::t('app', 'Chose'), ['id' => $model . "_" . $rKey . "_upload"]) . Html::buttonInput(Yii::t('app', 'Delete'), ['id' => $model . "_" . $rKey . "_remove"]) . "</div></div>";
            $idf = $model . "_" . $rKey . "_input";
            $script = "\n                    \$(document).on('click','#{$model}_{$rKey}_upload', function () {\n                        \$('#{$idf}').click();\n                    });\n                    \$(document).on('click','#{$model}_{$rKey}_remove', function () {\n                        //del();\n                    });\n                        \n                    ";
            Yii::$app->controller->view->registerJs($script, \yii\web\View::POS_READY);
        } elseif ($sModel == 'boolean') {
            //$label = Yii::t('app', $sModel->id);
            $field = Html::hiddenInput($model . '[' . $key . '][value]', false) . Html::checkbox($model . '[' . $key . '][value]', $value == 'true' ? true : false, ['class' => 'form-control']);
        } elseif ($sModel == 'date') {
            //$label = Yii::t('app', $sModel->id);
            $name = str_replace("[", "_", str_replace("]", "_", $model));
            $id = $name . "-" . $key;
            $rname = $model . "[" . $key . "][value]";
            $timezone = Yii::$app->timezone;
            $base = yii\helpers\BaseUrl::base();
            $field = <<<java
                    <div class="input-group date">
                        <span class="input-group-addon kv-date-calendar" title="Select date">
                            <i class="glyphicon glyphicon-calendar"></i>
                        </span>
                    <input type="text" id="{$id}-disp" class="form-control" name="{$rname}-w0" value="{$value}" data-krajee-datecontrol="datecontrol_b5142286" data-datepicker-type="2" data-krajee-kvdatepicker="kvDatepicker_158f0063"></div>
                    <input type="hidden" id="{$id}" name="{$rname}">
                    <script>
                        var kvDatepicker_158f0063 = {"autoclose":true,"format":"dd/mm/yyyy"};
                        var datecontrol_37eef6f1 = {"idSave":"{$id}","url":"{$base}/datecontrol/parse/convert","type":"date","saveFormat":"Y-m-d","dispFormat":"d/m/Y","asyncRequest":true};
                        jQuery('#{$id}-disp').datecontrol(datecontrol_37eef6f1);
                        jQuery('#{$id}-disp').parent().kvDatepicker(kvDatepicker_158f0063);
                    </script>
java;
            //$field.="<script>jQuery('#{$name}{$key}_value').datepicker();</script>";
        } else {
            //$label = Yii::t('app', $sModel->id);
            $field = Html::textInput($model . '[' . $key . '][value]', $value, ['class' => 'form-control']);
        }
        return $field;
    }
开发者ID:chaimvaid,项目名称:linet3,代码行数:71,代码来源:EAVHelper.php

示例3: run

 public function run()
 {
     $this->registerClientScript();
     if ($this->hasModel()) {
         $input = Html::activeTextInput($this->model, $this->attribute, $this->options);
     } else {
         $input = Html::textInput($this->name, $this->value, $this->options);
     }
     /*        
             $route = $this->captchaAction;
             if (is_array($route)) {
                 $route['v'] = uniqid();
             } else {
                 $route = [$route, 'v' => uniqid()];
             }
             $button = Html::img($route, $this->buttonOptions);
             echo strtr($this->template, [
                 '{input}' => $input,
                 '{button}' => $button,
             ]);
     */
     $button = Html::buttonInput($this->buttonLabel, $this->buttonOptions);
     echo strtr($this->template, ['{input}' => $input, '{button}' => $button]);
 }
开发者ID:noikiy,项目名称:wowewe,代码行数:24,代码来源:SmCaptcha.php

示例4: buttonInput

 /**
  * @inheritdoc
  */
 public static function buttonInput($label = 'Button', $options = [])
 {
     static::addCssClasses($options, ['ui', 'button']);
     return parent::buttonInput($label, $options);
 }
开发者ID:2amigos,项目名称:yii2-semantic-ui,代码行数:8,代码来源:Ui.php

示例5: testButtonInput

 public function testButtonInput()
 {
     $this->assertEquals('<input type="button" value="Button">', Html::buttonInput());
     $this->assertEquals('<input type="button" class="a" name="test" value="text">', Html::buttonInput('text', ['name' => 'test', 'class' => 'a']));
 }
开发者ID:rajanishtimes,项目名称:basicyii,代码行数:5,代码来源:HtmlTest.php

示例6:

    <?php 
echo $form->field($model, 'username')->label('Логин');
?>

    <?php 
echo $form->field($model, 'password')->label('Пароль')->passwordInput();
?>

    <?php 
echo $form->field($model, 'rememberMe', ['template' => "<div class=\"col-lg-offset-1 col-lg-3\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>"])->label('Запомнить')->checkbox();
?>

    <div class="form-group">
        <div class="col-lg-offset-1 col-lg-11">
            <?php 
echo Html::submitButton('Вход', ['class' => 'btn btn-primary', 'name' => 'login-button']);
?>
	    <?php 
echo Html::buttonInput('Регистрация', ['class' => 'btn btn-success', 'name' => 'reg-button']);
?>
        </div>
    </div>

    <?php 
ActiveForm::end();
?>

   
</div>
开发者ID:Arokh09,项目名称:it-service,代码行数:29,代码来源:login.php

示例7: number_format

</p>
                <p><strong><?php 
echo \Yii::t('app', 'Used Space');
?>
: </strong><?php 
echo number_format($usedSpace, 2);
?>
 Mb</p>
            </div>

            <?php 
echo Html::buttonInput(\Yii::t('app', 'Change Email'), ['class' => 'btn right-side left-space bottom-space btn-info add-file-btn', 'id' => 'email-modal-open-button']);
?>

            <?php 
echo Html::buttonInput(\Yii::t('app', 'Change Password'), ['class' => 'btn right-side bottom-space btn-info add-file-btn', 'id' => 'password-modal-open-button']);
?>
        </div>
    </div>

<?php 
echo $this->render('partials/_changeEmailModal', ['model' => $model]);
?>

<?php 
echo $this->render('partials/_changePasswordModal', ['model' => $passwordForm]);
?>

<?php 
$this->registerJs("\n    \$('#email-modal-open-button').on('click', function(e) {\n        \$('#modal-change-email').modal('show');\n    });\n\n    \$('#password-modal-open-button').on('click', function(e) {\n        \$('#modal-change-password').modal('show');\n    });\n", View::POS_READY, 'modalScripts');
?>
开发者ID:vfokov,项目名称:tims2,代码行数:31,代码来源:profile.php

示例8:

?>
                            <?php 
echo Html::dropDownList('', '', PaymentMethod::selectOptions($branch_id), ['class' => 'form-control', 'id' => 'inp-payment-method']);
?>
                        </div>
                        <div class="col-lg-4">
                            <?php 
echo Html::label('Value');
?>
                            <?php 
echo Html::textInput('', '', ['class' => 'form-control', 'id' => 'inp-payment-value']);
?>
                        </div>
                        <div class="col-lg-2" style="padding-left: 0px;">
                            <?php 
echo Html::buttonInput('Add', ['class' => 'btn btn-primary', 'style' => 'margin-top:24px;', 'id' => 'btn-payment-add']);
?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="box-footer box-comments hidden" id="payment-completion">
                <div class="col-lg-12">
                    <?php 
echo Html::a('Complete', null, ['class' => 'btn btn-success', 'id' => 'submit-btn', 'data-method' => 'post']);
?>
</div>
            </div>
        </div>
    </div>
    <?php 
开发者ID:sangkil,项目名称:biz3-distro,代码行数:31,代码来源:_form.php

示例9:

<label for='$name'><?php 
echo $label;
?>
</label>
<div id='<?php 
echo $id;
?>
_div'>
    <?php 
echo $text;
?>
</div>


<?php 
echo \yii\helpers\Html::buttonInput($label, ['class' => 'btn btn-success', 'id' => $id . '-button']);
?>
<a href='#' onclick="$('#<?php 
echo $id;
?>
_ids').val('');
        $('#<?php 
echo $id;
?>
_div').html('');
        return false;"> <?php 
echo \Yii::t('app', 'Clear refnum');
?>
</a>
        <?php 
$java = <<<java
开发者ID:chaimvaid,项目名称:linet3,代码行数:31,代码来源:Refnum.php


注:本文中的yii\helpers\Html::buttonInput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。