本文整理汇总了PHP中yii\helpers\Html::submitInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::submitInput方法的具体用法?PHP Html::submitInput怎么用?PHP Html::submitInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\helpers\Html
的用法示例。
在下文中一共展示了Html::submitInput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$model = $this->model;
$input = Html::input('text', 'code', '', ['class' => 'input buy']);
//$button = Html::submitButton('В корзину', ['class' => 'btn btn-lg ', 'name' => 'buy-button']);
$button = Html::submitInput('В корзину', ['class' => 'btn btn-primary', 'name' => 'buy-button']);
return Html::tag('div', $input . ' ' . $button, ['class' => 'buy-button']);
}
示例2: run
public function run()
{
$model = new \frontend\models\Search();
$form = ActiveForm::begin(['action' => '/search']);
echo $form->field($model, 'search', ['template' => '{error}{input}'])->textInput()->label(false);
echo Html::submitInput('', ['class' => 'search_submit']);
ActiveForm::end();
}
示例3: saveStay
/**
* Adds a save button. When clicked the form will be submitted with the $_POST value
* of "saveAndStay". Use [[stayAfterSave()]] to redirect appropriately in a controller.
*
* This method MUST be called within a form as it renders a hidden form field. The
* hidden field is used to save the form with a submit button outside the form.
*
* @param string $text a text for the button.
* @param string $icon name of an icon type to use
* @param array $options additional tag options
* @return Toolbar the current toolbar instance to support chaining.
*/
public function saveStay($text = null, $icon = 'refresh', $options = [])
{
if ($text === null) {
$text = Yii::t('cms/toolbar', 'Update');
}
Yii::$app->getView()->registerJs('
$("#save-stay-button").click(function(e){
$("#' . static::POST_VAR_SAVE_STAY . '").val("1");
});
$("#save-button").click(function(e){
$("#' . static::POST_VAR_SAVE_STAY . '").val("0");
});
');
$this->items[] = Html::label($this->createText($icon, $text), 'save-stay-button', $this->createButtonOptions($options));
echo Html::submitInput('saveStay', ['style' => 'display:none;', 'id' => 'save-stay-button']);
echo Html::hiddenInput(static::POST_VAR_SAVE_STAY, '', ['id' => static::POST_VAR_SAVE_STAY]);
return $this;
}
示例4:
<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
$this->title = Yii::t('app', 'USER_PROFILE_UPDATE');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'USER_PROFILE_TITLE'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
$form = ActiveForm::begin();
echo $form->field($model, 'email');
echo Html::submitInput(Yii::t('app', 'BTN_SAVE'), ['class' => 'btn btn-success']);
ActiveForm::end();
示例5: testSubmitInput
public function testSubmitInput()
{
$this->assertEquals('<input type="submit" value="Submit">', Html::submitInput());
$this->assertEquals('<input type="submit" class="a" name="test" value="text">', Html::submitInput('text', ['name' => 'test', 'class' => 'a']));
}
示例6:
$template = <<<STD
<div class="form-group field-user-password required has-error">
<div class="col-lg-6">{input}</div>
<label class="col-lg-3 control-label" for="user-password">{image}</label>
</div>
STD;
echo $form->field($model, 'captcha')->widget(Captcha::className(), ['captchaAction' => '/admin/public/captcha', 'template' => $template, 'imageOptions' => ['style' => 'width: 80px; height: 30px;']]);
?>
<div class="form-group">
<!--<input type="submit" value="登录" class="btn btn-success center-block">-->
<div class="col-lg-offset-3 col-lg-11">
<?php
echo Html::submitInput('登录', ['class' => 'btn btn-success ']);
?>
</div>
</div>
</div>
<?php
\yii\widgets\ActiveForm::end();
?>
</div>
</div>
</div>
示例7:
<div class="login-head">欢迎来到名坡绿茶,我们将竭诚为你服务。</div>
<div class="login-con">
<?php
$form = ActiveForm::begin(['id' => 'login-form', 'options' => ['class' => 'login-form']]);
?>
<?php
echo $form->field($model, 'mobile')->textInput(['class' => 'login-text', 'placeholder' => '手机号码/昵称'])->label('');
?>
<?php
echo $form->field($model, 'password')->passwordInput(['class' => 'login-paw', 'placeholder' => '密码'])->label('');
?>
<?php
echo $form->field($model, 'verifyCode')->widget(Captcha::className(), ['template' => '<div>{image}{input}</div>', 'imageOptions' => ['alt' => '验证码', 'class' => 'login-obtain'], 'captchaAction' => 'site/captcha', 'options' => ['class' => 'login-yzm', 'placeholder' => '验证码']])->label('');
?>
<?php
echo Html::submitInput('登录', ['class' => 'login-btn', 'name' => 'login-button']);
?>
<?php
ActiveForm::end();
?>
<a href="<?php
echo \common\widgets\FVariable::$siteForgetpsw_url;
?>
" class="login-forget">忘记密码?</a>
<div class="login-bottom">
还没有账号?<a href="<?php
echo \common\widgets\FVariable::$siteRegister_url;
?>
">注册</a>
</div>
</div>
示例8:
?>
<!-- --><?php
//= $form->field($model, 'rememberMe',
// ['template' => '<div class=\"checkbox\">{input}</div>'])->checkbox()
?>
<!-- --><?php
////= $form->field($model, 'rememberMe')->checkbox()
?>
<!-- <input id="check" type="checkbox" class = "checkbox" checked="checked">-->
<!-- <label for="check">Запомнить меня</label>-->
<div class="checkbox">
<input id="check" type="checkbox" class="checkbox" checked="checked">
<label for="check">Запомнить меня</label>
</div>
<p class="button">
<?php
echo Html::submitInput(Yii::t('app', 'Login'));
?>
</p>
<div class="form-footer">
<a href="/request-password-reset">Забыли пароль?</a>
<span><img src="img/arrow-new.png" alt=""><a href="http://evolineplus.by">Вернуться на главную</a></span>
</div>
<?php
ActiveForm::end();
?>
</div>
</main>
<!--End Content-->
示例9:
<?php
echo $form->field($user, 'username', ['template' => "<div class=\"field field-email text-field\">{input}<div class=\"status-box\"></div></div><div class=\"error-msg\">{error}</div>"])->textInput(['placeholder' => 'Email*']);
?>
<?php
echo $form->field($user, 'password', ['template' => "<div class=\"field field-pass text-field\">{input}<div class=\"status-box\"></div></div><div class=\"error-msg\">{error}</div>"])->passwordInput(['placeholder' => 'Пароль*']);
?>
<?php
echo $form->field($user, 'rememberMe', ['template' => "<div class=\"field field-remember checkbox-field\">{input}</div>"])->checkbox();
?>
<div class="field field-submit field-submit-login">
<?php
echo Html::submitInput(Yii::t('user', 'Войти'), ['class' => '']);
?>
</div>
<div class="field field-link field-link-login">
<?php
echo Html::a(Yii::t("user", "Напомнить пароль"), ["/user/forgot"]);
?>
</div>
<div class="form-description">
<span class="main-blue">*</span> - поля обязательны для заполнения
</div>
<?php
ActiveForm::end();
示例10:
echo $form->field($user, 'newPasswordConfirm', ['template' => '<div class="field field-pass2 text-field">{input}<div class="status-box"></div></div><div class="error-msg">{error}</div>'])->passwordInput(['placeholder' => 'Повторите пароль*']);
?>
<!-- <div class="preview-image"></div> -->
<?php
echo $form->field($user, 'avatar', ['template' => '<div class="preview-image"></div><div class="error-msg">{error}</div>' . '<div class="field field-avatar upload-button">' . '<div class="field-label">Аватар</div>{input}</div>'])->fileInput();
?>
<?php
echo $form->field($user, 'cropData')->hiddenInput(['id' => 'crop-data'])->label(false);
?>
<div class="field field-submit field-submit-register">
<?php
echo Html::submitInput('Зарегистрировать', ['class' => 'btn-register']);
?>
</div>
<div class="form-description">
<span class="main-blue">*</span> - поля обязательны для заполнения
</div>
<?php
ActiveForm::end();
?>
<?php
}
?>
</div>
示例11:
echo Alert::widget(['options' => ['class' => 'alert-success'], 'body' => 'Профиль изменён.']);
}
?>
<h1 class="text-center">Изменение профиля</h1>
<div class="row">
<div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($profileModel, 'email')->textInput(['maxlength' => 255]);
?>
<?php
echo $form->field($profileModel, 'name')->textInput(['maxlength' => 60]);
?>
<?php
echo $form->field($profileModel, 'password')->passwordInput(['maxlength' => 255])->hint('Оставьте поле пустым если не хотите его менять');
?>
<div class="form-group">
<?php
echo Html::submitInput('Сохранить', ['class' => 'btn btn-success']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
示例12:
<?php
$form = ActiveForm::begin(['options' => ['class' => 'default-form complain-form']]);
?>
<div class="user-photo">
<a href="<?php
echo Url::to(['user/profile']);
?>
"><img src="<?php
echo $avatar->getFileUrl();
?>
"></a>
</div>
<div class="field textarea-field comment-field">
<?php
echo $form->field($claim, 'message')->textArea(['maxlength' => 255, 'placeholder' => 'Введите ваше сообщение', 'class' => 'autosize'])->label(false);
?>
</div>
<div class="field field-submit">
<?php
echo Html::submitInput('Пожаловаться');
?>
</div>
<?php
ActiveForm::end();
?>
</div>
<?php
}
示例13:
<?php
$form = ActiveForm::begin([]);
?>
<?php
echo $form->field($model, 'user_name')->textInput();
?>
<?php
echo $form->field($model, 'email')->textInput();
?>
<?php
echo $form->field($model, 'password')->passwordInput();
?>
<?php
echo Html::submitInput("立即注册", ['class' => 'btn btn-primary']);
?>
<?php
ActiveForm::end();
?>
</div>
</div>
</div>
示例14: renderSubmit
function renderSubmit()
{
return Html::submitInput(null, ['class' => 'btn btn-primary']);
}
示例15: ActiveDataProvider
ActiveForm::end();
?>
</div>
<?php
if (!Yii::$app->user->isGuest) {
?>
<div class="row">
<div class="col-md-6">
<?php
$form = ActiveForm::begin(['id' => 'commentForm']);
?>
<?php
echo $form->field($model, 'body', ['options' => ['id' => 'commentBody']])->textarea(['id' => 'CommentForm[body]']);
?>
<?php
echo Html::submitInput(\Yii::t('app', 'Отправить'), ['class' => 'btn btn-primary']);
?>
<?php
ActiveForm::end();
?>
</div>
</div>
<?php
}
?>
<?php
$provider = new ActiveDataProvider(['query' => $comments, 'pagination' => ['pageSize' => 10]]);
?>
<div id="comments" style="padding: 2%;" >
<?php
foreach ($provider->getModels() as $comment) {