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']); }
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(); }
/** * 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; }
<?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();
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'])); }
$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>
<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>
?> <!-- --><?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-->
<?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();
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>
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>
<?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 }
<?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>
function renderSubmit() { return Html::submitInput(null, ['class' => 'btn btn-primary']); }
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) {
echo $form->field($AddressForm, 'detailAddress')->textarea(['class' => 'address-textarea'])->label('详细地址:'); ?> <?php echo $form->field($AddressForm, 'userMobile')->textInput(['class' => 'address-text'])->label('手机号码:'); ?> <?php echo $form->field($AddressForm, 'userPhone')->textInput(['class' => 'address-text'])->label('固定电话:'); ?> <?php echo $form->field($AddressForm, 'postNumber')->textInput(['class' => 'address-text'])->label('邮政编码:'); ?> <?php echo $form->field($AddressForm, 'isDefault')->label(false)->checkbox(['class' => 'address-check', 'label' => false])->label('是否默认:'); ?> <?php if (isset($prompt)) { echo '<div class="help-block" style="margin-left: 80px;">' . $prompt . '</div>'; } ?> <?php echo Html::submitInput('保存', ['class' => 'address-btn']); ?> <?php ActiveForm::end(); ?> </div> </div> </div> </div>
} echo $form->field($model, 'tags')->widget(SelectizeDropDownList::classname(), ['loadUrl' => '/admin/tag/tag-list', 'items' => $availableTags, 'options' => ['multiple' => true], 'clientOptions' => ['delimiter' => ',', 'valueField' => 'value', 'labelField' => 'text', 'persist' => false, 'createOnBlur' => true, 'maxItems' => 10, 'create' => new JsExpression('function(input) { return { value: "{new}" + input, text: input } }')]]); ?> <?php $pluginOptions = ['showUpload' => false, 'showRemove' => false, 'overwriteInitial' => true, 'browseLabel' => "Обзор...", 'allowedFileExtensions' => ['jpg', 'jpeg', 'gif', 'png']]; if (isset($image) && $image->getFileUrl()) { $pluginOptions['initialPreview'] = [Html::img($image->getFileUrl())]; } echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => false], 'pluginOptions' => $pluginOptions]); ?> <div> <div class="field field-submit"> <?php echo Html::submitInput($model->isNewRecord ? 'Добавить' : 'Изменить', []); ?> </div> <?php if (!$model->isNewRecord) { ?> <?php echo Html::a('Просмотр', $model->getUrl(), ['class' => 'field-button']); ?> <?php } ?> <div class="clearfix"></div> </div> <?php ActiveForm::end();
<?php echo $form->field($searchModel, 'max_price', ['template' => "{input}"])->textInput(['name' => $directPopulating ? 'max_price' : null, 'class' => 'without-left-border', 'placeholder' => $searchModel->getAttributeLabel('max_price')]); ?> <?php echo $form->field($searchModel, 'currency', ['template' => "{input}{error}", 'options' => ['tag' => false]])->dropDownList(Currency::getDropDownList(), ['name' => $directPopulating ? 'currency' : null, 'emptyItem' => Yii::t('app', 'Currency')]); ?> <?php Spaceless::end(); ?> <div class="clear"></div> </div> <div class="button-container"> <?php echo Html::submitInput('Искать', ['class' => 'clear']); ?> <?php $js = <<<JS \$('#detaile-search-panel .button-container input').hide(); jQuery('#detaile-search-form').on('change.yiiActiveForm', function(event) { \$.pjax.submit(event, '#advert-list-pjax'); }); jQuery(document).on('pjax:beforeSend', function(data, xhr, options) { var targetId = options.target ? options.target.id : null; if (targetId == 'detaile-search-form' || targetId == 'search-form') { var params = [];; var func = function(i, field) { if (field.value) { params.push(field.name + '=' + field.value);
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; use yii\bootstrap\Modal; $form = ActiveForm::begin(['id' => 'comment-form', 'action' => ['/site/add-comment'], 'fieldConfig' => ['template' => "{input}\n{hint}\n{error}"], 'enableClientValidation' => true]); Modal::begin(['header' => '<h4>Новый отзыв</h4>', 'footer' => Html::button($cancelButtonText, ['class' => 'btn btn-warning cancel pull-right', 'data-dismiss' => 'modal']) . ' ' . Html::submitInput($sendButtonText, ['class' => 'btn btn-primary pull-right']), 'id' => 'modal-new-comment']); ?> <div class="row"> <div class="col-md-12"> <?php echo $form->field($model, 'text')->textarea(['rows' => 6, 'maxlength' => $this->context->maxLength]); ?> <?php echo Html::activeHiddenInput($model, 'object'); ?> <?php echo Html::activeHiddenInput($model, 'object_id'); ?> <?php echo Html::activeHiddenInput($model, 'parent_id'); ?> <?php echo Html::hiddenInput('level', null, ['id' => 'comment-level']); ?> </div> </div> <?php Modal::end(); ?>
<div class="Derivacion-reclamo-sugerencia-create"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['sRS.rECNUMERO.REC_NUMERO', 'sRS.rECNUMERO.tRS.TRS_TIPO', 'sRS.rECNUMERO.REC_MOTIVO', 'sRS.SRS_ANTECEDENTES']]); ?> <?php $form = ActiveForm::begin(['enableAjaxValidation' => true]); ?> <?php echo $form->field($model, 'DRS_SERVICIO_NO_CONFORME')->radioList(array('Si' => 'Si', 'No' => 'No')); ?> <?php echo $form->field($model, 'DRS_RESPUESTA')->textArea(array('rows' => 3)); ?> <?php echo Html::submitInput('Responder', ['class' => 'btn btn-primary']); ?> <?php $form = ActiveForm::end(); ?> </div>
<?php /** Autor: Victor Montoya Fecha: 29/09/15 Descripción: vista para realizar formulario validado y conectado a un modelo */ use yii\helpers\Html; use yii\widgets\ActiveForm; ?> <?php $form = ActiveForm::begin(["method" => "post", "enableClientValidation" => true]); ?> <div class="form-group"> <?php echo $form->fiel($model, "nombre")->input("text"); ?> </div> <div class="form-group"> <?php echo $form->fiel($model, "email")->input("email"); ?> </div> <?php echo Html::submitInput("Enviar", ["class" => "btn btn-primary"]); $form->end();
"><img src="<?php echo $avatar->getFileUrl(); ?> "></a> </div> <div class="field textarea-field comment-field"> <?php echo $form->field($commentForm, 'content')->textArea(['placeholder' => 'Введите ваше сообщение', 'class' => 'autosize'])->label(false); ?> </div> <?php echo $form->field($commentForm, 'commentable_id')->hiddenInput(['value' => $commentForm->commentable_id])->label(false); echo $form->field($commentForm, 'commentable_type')->hiddenInput(['value' => $commentForm->commentable_type])->label(false); echo $form->field($commentForm, 'parent_id')->hiddenInput()->label(false); ?> <div class="comment-bottom"> <div class="field field-submit"> <?php echo Html::submitInput('Добавить комментарий'); ?> </div> <div class="reply-data"> Ответ для <span class="user">Пользователь</span> <a href="javascript:void(0)" class="button-cancel" title="Отменить"></a> </div> </div> <?php ActiveForm::end();
return Url::toRoute(['acervo/update-ingreso', 'id' => $key]); } if ($action == 'view') { return Url::toRoute(['acervo/view', 'id' => $key]); } if ($action == 'delete') { return Url::toRoute(['acervo/delete', 'id' => $key]); } }, 'viewOptions' => ['title' => 'Ver detalles del acervo', 'data-toggle' => 'tooltip'], 'updateOptions' => ['url' => 'urlCreator', 'title' => 'Para actualizar el Acervo', 'data-toggle' => 'tooltip'], 'deleteOptions' => ['url' => 'urlCreator', 'title' => 'Eliminar el acervo', 'data-toggle' => 'tooltip'], 'headerOptions' => ['class' => 'kartik-sheet-style'], 'buttons' => ['delete' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['data-confirm' => Yii::t('yii', '¿Confirma borrar el Acervo asociado?'), 'data-method' => 'post']); }]]]; echo GridView::widget(['dataProvider' => $dataObject, 'columns' => $gridColumns, 'resizableColumns' => true, 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'pjax' => true, 'toolbar' => [['content' => Html::submitButton('<i class="glyphicon glyphicon-plus"></i>', ['class' => 'btn btn-success', 'name' => 'newObjectButton', 'id' => 'newObjectButton', 'value' => 'newObjectButton', 'onClick' => "jQuery('#action').val('" . \app\controllers\IngresoController::NEW_OBJECT . "')"])]], 'bordered' => true, 'striped' => true, 'condensed' => true, 'responsive' => true, 'hover' => true, 'showPageSummary' => false, 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => $heading], 'persistResize' => false]); ?> </div> </div> <div class="form-group"> <?php echo Html::submitInput($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary', 'name' => 'saveButton', 'id' => 'saveButton', 'value' => 'saveButton', 'onClick' => "jQuery('#action').val('" . \app\controllers\IngresoController::USER_SAVE_INGRESO . "')"]); ?> </div> <?php ActiveForm::end(); ?> </div>
use yii\helpers\Html; use yii\widgets\ActiveForm; use yii\helpers\ArrayHelper; use app\models\SolucionReclamoSugerencia; use app\controllers\ReclamoSugerenciaController; ?> <div class="reclamo-sugerencia-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($reclamo, 'REC_VISTO_BUENO')->radioList(array('Autorizado' => 'Autorizar', 'Rechazado' => 'Rechazar')); ?> <?php echo Html::submitInput('Envaluar', ['class' => 'btn btn-primary']); ?> <?php $form = ActiveForm::end(); ?> </div>
<?php echo $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '+7-999-999-99-99', 'options' => ['placeholder' => 'phone*:']]); ?> <?php echo $form->field($model, 'body', ['options' => ['class' => "message"]])->textarea(['placeholder' => 'Текст сообщения*:']); ?> <div> <div class="clear"></div> <div class="btns"> <?php echo Html::submitInput('Отправить', ['class' => 'btn']); ?> <span>* - Необходимо заполнить поля</span> </div> </div> <?php ActiveForm::end(); ?> </div> </div> </div>
echo Html::encode($this->title); ?> </h1> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['REC_NUMERO', 'rECNUMERO.tRS.TRS_TIPO', 'rECNUMERO.REC_MOTIVO', 'rECNUMERO.REC_VISTO_BUENO', 'rECNUMERO.eRS.ERS_ESTADO', 'SRS_COMENTARIO', 'SRS_ANTECEDENTES']]); ?> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($derivacion, 'USU_RUT')->textInput(); ?> <?php echo $form->field($derivacion, 'DRS_CARGO')->textInput(); ?> <?php echo $form->field($derivacion, 'DRS_UNIDAD')->textInput(); ?> <?php echo Html::submitInput('Derivar', ['class' => 'btn btn-primary']); ?> <?php $form = ActiveForm::end(); ?> </div>
<?php use roman444uk\yii\widgets\ActiveForm; use yii\helpers\Html; $searchModel = $this->params['searchModel']; ?> <div id="search-container"> <?php $form = ActiveForm::begin(['id' => 'search-form', 'method' => 'get', 'action' => '/']); echo $form->field($this->params['searchModel'], 'content', ['template' => '{input}', 'options' => ['tag' => false]])->textInput(['name' => !$this->params['directPopulating'] ? 'content' : null]); echo Html::submitInput('', ['class' => 'icon sm zoom']); ActiveForm::end(); ?> </div> <?php $js = <<<JS jQuery('#search-form').on('submit.yiiActiveForm', function(event) { \$.pjax.submit(event, '#advert-list-pjax'); }); JS; $this->registerJs($js);
<div class="field field-submit-grey field-submit-subscribe"> <a class="button" href="<?php echo Url::to('/unsubscribe/' . $user->getUnsubscribeKey()); ?> "> Отписаться от новостей </a> </div> <?php } ?> <!-- <div class="replies-subscribe-box"> <div class="input-box"> <input id="replies-subscribe-check" type="checkbox" name="replies-subscribe-check"> </div> <label for="replies-subscribe-check" class="">Присылать на e-mail ответы на мои комментарии</label> </div> --> <div class="field field-submit field-submit-edit"> <?php echo Html::submitInput("Изменить настройки"); ?> </div> </div> <div class="clearfix"></div> <?php ActiveForm::end(); ?> </div>
/** * @inheritdoc */ public static function submitInput($label = 'Submit', $options = []) { static::addCssClasses($options, ['ui', 'button']); return parent::submitInput($label, $options); }
<?php echo $form->field($noteSearch, 'user.name'); ?> <?php } ?> <?php echo $form->field($noteSearch, 'name'); ?> <?php echo $form->field($noteSearch, 'description')->textarea(['rows' => 2]); ?> <div class="form-group"> <?php echo Html::submitInput('Поиск', ['class' => 'btn btn-info']); ?> <?php echo Html::a('Сбросить', [''], ['class' => 'btn btn-info']); ?> </div> <?php ActiveForm::end(); ?> </div> </div> </div> <div class="panel panel-primary"> <div class="panel-heading" role="tab" id="headingSort"> <div class="panel-title">