本文整理汇总了PHP中kartik\helpers\Html::activeHiddenInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::activeHiddenInput方法的具体用法?PHP Html::activeHiddenInput怎么用?PHP Html::activeHiddenInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\helpers\Html
的用法示例。
在下文中一共展示了Html::activeHiddenInput方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
parent::run();
$wid = $this->options['id'];
echo Html::activeHiddenInput($this->model, $this->attribute);
echo Html::beginTag('div', ['id' => $wid . '-buttons', 'class' => 'input-group btn-group']);
$items = PublishBehavior::getPublishedOptions();
$colors = PublishBehavior::getPublishedColors();
foreach ($items as $key => $item) {
echo Html::button($item, ['data' => ['value' => $key], 'class' => $key == $this->model->{$this->attribute} ? 'btn btn-' . $colors[$key] . ' active' : 'btn btn-default']);
}
echo Html::endTag('div');
$js_colors = Json::encode($colors);
$js = <<<JS
\$('#{$wid}-buttons').find('button').each(function(){
\$(this).on('click',function(){
\$('#{$wid}-buttons').find('button').each(function(){
\$(this).removeClass('btn-danger btn-warning btn-success btn-info active');
\$(this).addClass('btn-default');
});
var color={$js_colors};
\$(this).removeClass('btn-default');
\$(this).addClass('btn-'+color[\$(this).data('value')]+' active');
\$('#{$wid}').val(\$(this).data('value'))
});
});
JS;
$this->view->registerJs($js);
}
示例2: init
public function init()
{
echo Html::activeHiddenInput($this->model, $this->attribute, $this->options);
echo Html::error($this->model, $this->attribute, $this->options);
$id = Html::getInputId($this->model, $this->attribute);
echo FileInput::widget(['name' => 'file', 'options' => ['accept' => 'image/*', 'multiple' => false], 'pluginEvents' => ['fileuploaded' => 'function(event, data, previewId, index) {
$("#' . $id . '").val(data.response.url);
}'], 'pluginOptions' => ['initialPreview' => $this->model->{$this->attribute} ? [Html::img($this->model->{$this->attribute}, ['class' => 'file-preview-image'])] : false, 'maxFileCount' => 1, 'minFileCount' => 1, 'previewFileType' => 'image', 'multiple' => false, 'showPreview' => true, 'showUploadedThumbs' => false, 'uploadUrl' => \yii\helpers\Url::to(['/system/image/upload'])]]);
parent::init();
}
示例3:
<div class = "y2u-padding">
<div class="page-header">
<h3><?php
echo Yii::t('user', 'Getting Started');
?>
<small><?php
echo Yii::t('user', 'Step 1 of 2');
?>
</small>
</h3>
</div>
<?php
echo $form->field($model, 'access_code')->passwordInput()->hint($hints['access_code']);
?>
<?php
echo Html::activeHiddenInput($model, 'action');
?>
</div>
<div class="y2u-box-footer">
<?php
echo Html::a('<i class="glyphicon glyphicon-question-sign"></i> ' . Yii::t('user', 'Help'), '#help', ['class' => 'btn btn-info pull-left', 'onclick' => '$("#help").slideToggle("slow");']);
?>
<?php
echo Html::submitButton(Yii::t('user', 'Proceed') . ' »', ['class' => 'btn btn-success']);
?>
</div>
</div>
<?php
ActiveForm::end();
?>
<br>