本文整理汇总了PHP中kartik\helpers\Html::getInputName方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::getInputName方法的具体用法?PHP Html::getInputName怎么用?PHP Html::getInputName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\helpers\Html
的用法示例。
在下文中一共展示了Html::getInputName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
</div>
<?php
\yii\widgets\ActiveForm::end();
?>
<!--回复-->
<?php
$form = \yii\widgets\ActiveForm::begin(['action' => \yii\helpers\Url::toRoute('comment/create'), 'options' => ['class' => 'reply-form hidden']]);
?>
<?php
echo Html::hiddenInput(Html::getInputName($commentModel, 'article_id'), $model->category_id);
?>
<?php
echo Html::hiddenInput(Html::getInputName($commentModel, 'comment_type'), 'gallery');
?>
<?php
echo Html::hiddenInput(Html::getInputName($commentModel, 'parent_id'), 0, ['class' => 'parent_id']);
?>
<?php
echo $form->field($commentModel, 'content')->label(false)->textarea();
?>
<div class="form-group">
<?php
if (!Yii::$app->user->isGuest) {
?>
<button type="submit" class="btn btn-sm btn-primary">回复</button>
<?php
} else {
?>
<?php
echo Html::a('登录', ['/site/login'], ['class' => 'btn btn-primary']);
?>
示例2: function
?>
-jstree").jstree(<?php
echo $options;
?>
).parents('form').eq(0).submit(function() {
$('#<?php
echo $id;
?>
input[type=hidden]').remove();
var ids = $("#<?php
echo $id;
?>
-jstree").jstree('get_selected');
for (var key in ids) {
$('<input />').attr('type', 'hidden').attr('name', '<?php
echo Html::getInputName($model, $fieldName) . ($multiple ? '[]' : '');
?>
').attr('value', ids[key]).appendTo($('#<?php
echo $id;
?>
'));
}
return true;
});
$("#<?php
echo $id;
?>
-jstree").bind("dblclick.jstree", function (event) {
var $object = $(event.target).closest("a");
}).bind('changed.jstree', function(e, data) {
var $select = $('#<?php
示例3:
<style>
.search .form-control{ width:300px;}
.search .form-group{ margin:0 10px;}
</style>
<?php
use kartik\widgets\ActiveForm;
use kartik\helpers\Html;
$form = ActiveForm::begin(['method' => 'get', 'type' => ActiveForm::TYPE_INLINE, 'options' => ['class' => 'search']]);
if ($model->render == 'reg-user') {
echo $form->field($model, 'userId');
}
//echo $form->field($model, 'filter_limit');
echo $form->field($model, 'regdate', [])->widget(\kartik\daterange\DateRangePicker::classname(), ['attribute' => "regdate", 'model' => $model, 'convertFormat' => true, 'pluginOptions' => ['timePicker' => true, 'timePickerIncrement' => 15, 'timePicker24Hour' => true, 'locale' => ['separator' => ' 至 ', 'format' => 'Y-m-d H:i:s'], 'opens' => 'right']]);
?>
<div style="display: inline-block">
<?php
echo \kartik\widgets\Select2::widget(['name' => 'filter_limit', 'value' => \yii::$app->request->get('filter_limit', 50), 'data' => [20 => 20, 50 => 50, 100 => 100, 200 => 200], 'options' => ['placeholder' => '每页条数']]);
?>
</div>
<?php
echo Html::submitButton("搜索", ['class' => 'btn btn-success', 'name' => Html::getInputName($model, 'do'), 'value' => 'search']);
//echo " ";
//echo Html::submitButton("更新", [
// 'class' => 'btn btn-info',
// 'name' =>Html::getInputName($model,'do'),
// 'value'=>'update'
//]);
ActiveForm::end();