本文整理匯總了PHP中yii\bootstrap\Html::resetButton方法的典型用法代碼示例。如果您正苦於以下問題:PHP Html::resetButton方法的具體用法?PHP Html::resetButton怎麽用?PHP Html::resetButton使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yii\bootstrap\Html
的用法示例。
在下文中一共展示了Html::resetButton方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
<?php
// echo $form->field($model, 'editor')
?>
<?php
// echo $form->field($model, 'updated_time')
?>
<?php
// echo $form->field($model, 'promotion')
?>
<?php
// echo $form->field($model, 'status')
?>
<div class="form-group">
<?php
echo Html::submitButton(Yii::t(Yii::$app->controller->module->id, 'Search'), ['class' => 'btn btn-primary']);
?>
<?php
echo Html::resetButton(Yii::t(Yii::$app->controller->module->id, 'Reset'), ['class' => 'btn btn-default']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例2:
?>
</div>
<div class="panel-body">
<?php
$form = ActiveForm::begin(['id' => 'change-password-form']);
?>
<?php
echo $form->field($resetPasswordForm, 'password')->passwordInput();
?>
<?php
echo $form->field($resetPasswordForm, 'confirmPassword')->passwordInput();
?>
<div class="form-group">
<?php
echo Html::resetButton(Yii::t('user', 'Cancel'), ['class' => 'btn btn-default']);
?>
<?php
echo Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-success']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading no-bottom-border">
<?php
示例3: isset
$newComment->parent_id = 0;
$this->registerJsFile(Yii::$app->request->baseUrl . '/js/comment/comment.js', ['depends' => [\yii\web\JqueryAsset::className()]]);
$thisUser = User::thisUser();
?>
<div id="blockComments">
<div class="row margin-bottom">
<div class="col-md-12">
<?php
if (!Yii::$app->user->isGuest && $thisUser->reputation >= Comment::MIN_REPUTATION_COMMENT_CREATE) {
$form = ActiveForm::begin(['action' => ['comment/add'], 'id' => 'main-comment-form']);
echo $form->field($newComment, 'entity')->hiddenInput()->label(false);
echo $form->field($newComment, 'entity_id')->hiddenInput()->label(false);
echo $form->field($newComment, 'parent_id')->hiddenInput(['class' => 'comment-parent-id'])->label(false);
echo $form->field($newComment, 'description', ['inputOptions' => ['class' => 'form-control', 'placeholder' => Lang::t('main/comments', 'addCommentDescription')]])->textarea()->label(false);
echo Html::submitButton(Lang::t('main/comments', 'buttonAddComment'), ['class' => 'btn btn-primary pull-right', 'name' => 'list-add-button']);
echo Html::resetButton(Lang::t('main/comments', 'buttonCancelComment'), ['class' => 'btn btn-default pull-right btn-cancel-comment', 'style' => 'margin-right: 10px;']);
ActiveForm::end();
}
?>
</div>
</div>
<div class="row">
<?php
foreach ($comments as $comment) {
echo $this->render('view', ['comment' => $comment, 'voteItem' => isset($voteItems[$comment->id]) ? $voteItems[$comment->id] : null]);
echo "<div class='col-md-12'><div class='row comment-reply-block'>";
if (!empty($commentsParent[$comment->id])) {
foreach (array_reverse($commentsParent[$comment->id]) as $commentReply) {
echo $this->render('view', ['comment' => $commentReply, 'voteItem' => isset($voteItems[$commentReply->id]) ? $voteItems[$commentReply->id] : null]);
}
示例4:
<?php
$form = \yii\widgets\ActiveForm::begin();
?>
<?php
echo $form->field($model, 'username')->label('用戶名');
?>
<?php
echo $form->field($model, 'email')->label('郵箱');
?>
<?php
echo $form->field($model, 'password')->passwordInput()->label('密碼');
?>
<?php
echo $form->field($model, 'repassword')->passwordInput()->label('確認密碼');
?>
<div class="form-group">
<?php
echo \yii\helpers\Html::submitButton($model->isNewRecord ? '添加' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
<?php
echo \yii\bootstrap\Html::submitButton($model->isNewRecord ? '添加' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
<?php
echo \yii\bootstrap\Html::resetButton('重置', ['class' => "btn btn-default"]);
?>
</div>
<?php
\yii\widgets\ActiveForm::end();
?>
</div>