當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Html::submitInput方法代碼示例

本文整理匯總了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']);
 }
開發者ID:slam-mt,項目名稱:yii2-shop,代碼行數:8,代碼來源:Buy.php

示例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();
 }
開發者ID:kuzma17,項目名稱:asu,代碼行數:8,代碼來源:Search.php

示例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;
 }
開發者ID:bigbrush,項目名稱:yii2-cmf,代碼行數:30,代碼來源:Toolbar.php

示例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();
開發者ID:kvaxminsk,項目名稱:belpharma2,代碼行數:14,代碼來源:update.php

示例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']));
 }
開發者ID:rajanishtimes,項目名稱:basicyii,代碼行數:5,代碼來源:HtmlTest.php

示例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>



開發者ID:xiaohongyang,項目名稱:yii_shop,代碼行數:27,代碼來源:login.php

示例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>
開發者ID:jaybril,項目名稱:www.mimgpotea.com,代碼行數:31,代碼來源:login.php

示例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-->
開發者ID:kvaxminsk,項目名稱:evo8,代碼行數:31,代碼來源:login.php

示例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();
開發者ID:alexsynytskiy,項目名稱:Dynamomania,代碼行數:30,代碼來源:login_block.php

示例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>
開發者ID:alexsynytskiy,項目名稱:Dynamomania,代碼行數:31,代碼來源:register_block.php

示例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>

開發者ID:Sywooch,項目名稱:notes,代碼行數:29,代碼來源:profile.php

示例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 
}
開發者ID:alexsynytskiy,項目名稱:Dynamomania,代碼行數:31,代碼來源:complain_form.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>


開發者ID:xiaohongyang,項目名稱:yii_shop,代碼行數:28,代碼來源:register.php

示例14: renderSubmit

function renderSubmit()
{
    return Html::submitInput(null, ['class' => 'btn btn-primary']);
}
開發者ID:bangkok,項目名稱:member_api,代碼行數:4,代碼來源:index.php

示例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) {
開發者ID:kazachka,項目名稱:photo-yii-site,代碼行數:31,代碼來源:image.php


注:本文中的yii\helpers\Html::submitInput方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。