本文整理汇总了PHP中yii\bootstrap\Html::submitButton方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::submitButton方法的具体用法?PHP Html::submitButton怎么用?PHP Html::submitButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\Html
的用法示例。
在下文中一共展示了Html::submitButton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initBuy
/**
* Инициализация кнопки
* @param \frontend\models\Market $market
* @return string|void
*/
public function initBuy(\frontend\models\Market $market = null)
{
if ($market && isset($market->settings)) {
$settings = json_decode($market->settings, true);
} else {
$settings = array();
}
$xml_structure = $this->getStructure();
$html = \yii\bootstrap\Html::beginForm('?r=payqr/button/create' . (isset($market->id) ? "&market_id=" . $market->id : ""), 'post', []);
$html .= \yii\bootstrap\Html::csrfMetaTags();
//инициализируем общие настройки кнопки
foreach ($xml_structure as $row) {
if (isset($row['field'][0]['@attributes']['value']) && !$this->buttonStructure($row)) {
$html .= $this->generateHtml($row, $settings);
}
}
//инициализиурем параметры кнопки в соответствии с местом отображения
foreach ($this->ShowInPlace as $place => $placeTranslate) {
foreach ($this->buttonXmlStructure as $xmlrow) {
$html .= $this->generateHtml($xmlrow, $settings, array(0 => $place, 1 => $placeTranslate));
}
}
$html .= \yii\bootstrap\Html::submitButton('Сохранить');
$html .= \yii\bootstrap\Html::endForm();
return $html;
}
示例2: submitButton
public function submitButton($label, $options = [])
{
$buttonStr = Html::submitButton($label, array_merge($options, ['class' => 'btn btn-primary']));
if ($this->layout == 'horizontal') {
return "<div class=\"form-group\"><div class=\"col-sm-offset-3 col-sm-6\">{$buttonStr}</div></div>";
} else {
return "<div class=\"form-group\">{$buttonStr}</div>";
}
}
示例3: run
public function run()
{
$formId = $this->formOptions['id'];
$this->getView()->registerCss("#{$formId} button {-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);}");
$form = ActiveForm::begin(array_merge($this->defaultFormOptions, $this->formOptions));
print Html::beginTag('div', ['class' => 'row']);
print Html::beginTag('div', ['class' => 'col-xs-12']);
print Html::beginTag('div', ['class' => 'input-group']);
if ($this->inputWidget) {
print $form->field($this->model, $this->attribute, ['template' => '{input}'])->widget($this->inputWidget, $this->inputOptions);
} else {
print $form->field($this->model, $this->attribute, ['template' => '{input}'])->input($this->inputType, array_merge(['placeholder' => $this->model->getAttributeLabel($this->attribute), 'class' => 'form-control'], $this->inputOptions));
}
print Html::beginTag('span', ['class' => 'input-group-btn']);
print Html::submitButton(Yii::t('hipanel', 'Search'), ['class' => 'btn btn-flat ' . $this->buttonColor]);
print Html::endTag('span');
print Html::endTag('div');
print Html::endTag('div');
print Html::endTag('div');
ActiveForm::end();
}
示例4: run
public function run()
{
parent::run();
$content = Html::submitButton($this->model->isNewRecord ? self::t('messages', 'Create') : self::t('messages', 'Update'), ['class' => $this->model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
$jsCreateClose = <<<JS
var action = \$(this).parents('form').attr('action');
var submitButton = \$(this).parent().find('button[type=submit]');
\$(this).parents('form').attr('action', action + '&close=true');
submitButton.click();
return false;
JS;
$content .= ' ' . Html::a($this->model->isNewRecord ? self::t('messages', 'Create and close') : self::t('messages', 'Update and close'), '#', ['class' => 'btn btn-default btn-sm', 'onclick' => $jsCreateClose]);
$returnUrl = null;
if (\Yii::$app->controller->defaultAction === null) {
$returnUrl = \Yii::$app->user->returnUrl;
} else {
$returnUrl = [\Yii::$app->controller->defaultAction];
}
$content .= ' ' . Html::a(self::t('messages', 'Close'), $returnUrl, ['class' => 'btn btn-default btn-sm']);
$content = Html::tag('div', $content, ['class' => 'col-sm-8']) . Html::tag('div', $this->getInfoRecord(), ['class' => 'col-sm-4 text-right']);
return Html::tag('div', $content, ['class' => 'form-group well row']);
}
示例5:
?>
<div style="margin-top: 50px;">
<?php
echo !empty($passwordInfo) ? Html::tag('div', $passwordInfo, ['class' => 'alert alert-success']) : '';
?>
<h4><?php
echo Yii::t('app', 'Change Your Password');
?>
</h4>
<?php
echo !empty($passwordError) ? Html::tag('div', $passwordError, ['class' => 'alert alert-danger']) : '';
?>
<div class="row">
<div class="col-xs-6">
<?php
echo Html::passwordInput('password', '', ['class' => 'form-control', 'placeholder' => Yii::t('app', 'Enter new password')]);
?>
</div>
<div class="col-xs-6">
<?php
echo Html::submitButton(Yii::t('app', 'Update Password'), ['class' => 'btn btn-primary']);
?>
</div>
</div>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
示例6:
<div class="tag-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'slug')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'comment')->textarea();
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例7: array
<?php
if ($model->isAttributeSafe('currentPassword')) {
?>
<?php
echo $form->field($model, 'currentPassword')->passwordInput(['maxlength' => 45]);
?>
<hr>
<?php
}
?>
<?php
echo $form->field($model, 'newPassword')->passwordInput(['maxlength' => 45]);
?>
<?php
echo $form->field($model, 'newPasswordConfirm')->passwordInput(['maxlength' => 45]);
?>
<hr>
<?php
echo Html::submitButton(Yii::t('UserModule.views_account_changePassword', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => ''));
?>
<?php
echo \humhub\widgets\DataSaved::widget();
?>
<?php
ActiveForm::end();
$this->endContent();
示例8:
?>
</span>
<span class="input-group-addon" id="basic-addon1">
Название
</span>
<?php
echo Html::textInput('newWorkName', null, ['class' => 'form-control']);
?>
<span class="input-group-addon" id="basic-addon1">
Руководитель
</span>
<?php
echo Html::dropDownList('newWorkTeacher', null, $teachersArr, ['class' => 'form-control']);
?>
</div>
</div>
<div class="form-group">
<div class="col-lg-12">
<?php
echo Html::submitButton('Сохранить', ['class' => 'btn btn-primary']);
?>
</div>
</div>
<?php
ActiveForm::end();
Pjax::end();
?>
</div>
示例9: array
</div>
<div class="panel-body">
<p><?php
echo Yii::t('InstallerModule.views_config_sample-data', 'To avoid a blank dashboard after your initial login, HumHub can install example contents for you. Those will give you a nice general view of how HumHub works. You can always delete the individual contents.');
?>
</p>
<br>
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'sampleData')->checkbox();
?>
<hr>
<?php
echo Html::submitButton(Yii::t('base', 'Next'), array('class' => 'btn btn-primary', 'data-ui-loader' => ''));
?>
<?php
ActiveForm::end();
?>
</div>
</div>
示例10: loading
</div>
<?php
if (!Yii::$app->user->isGuest && Yii::$app->user->identity->isadmin) {
?>
<div class="row">
<?php
$form = \kartik\form\ActiveForm::begin(['type' => 'inline']);
echo $form->field($model, 'airline')->textInput(['style' => 'width: 100px;']);
echo $form->field($model, 'flightnumber')->textInput(['style' => 'width: 100px;']);
echo $form->field($model, 'gate')->textInput(['style' => 'width: 100px;']);
echo $form->field($model, 'aircraft')->textInput(['style' => 'width: 100px;']);
echo $form->field($model, 'icaofrom')->textInput(['style' => 'width: 100px;', 'readonly' => !$model->isarrival]);
echo $form->field($model, 'icaoto')->textInput(['style' => 'width: 100px;', 'readonly' => $model->isarrival == 1]);
echo $form->field($model, 'timefrom')->widget(\kartik\widgets\TimePicker::className(), ['pluginOptions' => ['showMeridian' => false], 'options' => ['style' => 'width: 100px;']]);
echo $form->field($model, 'timeto')->widget(\kartik\widgets\TimePicker::className(), ['pluginOptions' => ['showMeridian' => false], 'options' => ['style' => 'width: 100px;']]);
echo \yii\bootstrap\Html::submitButton('<i class="fa fa-check"></i>Add', ['class' => 'btn btn-success btn-sm']);
\kartik\form\ActiveForm::end();
?>
<hr />
<form method="post" class="form-horizontal" enctype="multipart/form-data">
<div class="form-group field-batch-loading">
<input id="form-token" type="hidden" name="<?php
echo Yii::$app->request->csrfParam;
?>
"
value="<?php
echo Yii::$app->request->csrfToken;
?>
"/>
<label class="control-label" for="batch-loading">Batch loading(<?php
echo \yii\helpers\Html::a("XLSX", \yii\helpers\Url::to(['/booking/export-' . strtolower($act), 'id' => $model->airport_id]));
示例11: array
<?php
foreach ($modules as $module) {
?>
<label>
<?php
echo Html::checkbox('enableModules[' . $module['id'] . ']', true);
echo $module['name'];
?>
</label>
<p class="help-block" style="margin: 0 0 10px 23px;"><?php
echo $module['description'];
?>
</p>
<hr>
<?php
}
?>
<?php
echo Html::submitButton(Yii::t('base', 'Next'), array('class' => 'btn btn-primary', 'data-loader' => "modal", 'data-message' => Yii::t('InstallerModule.base', 'Downloading & Installing Modules...')));
?>
<?php
echo Html::endForm();
?>
</div>
</div>
示例12:
use yii\bootstrap\Html;
use yii\easyii\modules\catalog\models\StaticUrl;
/**
* @var StaticUrl $model
*/
?>
<?php
echo $this->render('/items/_menu', ['category' => $model->category]);
?>
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'url')->input('text', ['readonly' => 'readonly']);
echo $form->field($model, 'page_description')->textarea();
echo $form->field($model, 'h2');
?>
<?php
echo $model->getSeoBehavior()->renderForm($this, $form);
?>
<?php
echo Html::submitButton(Yii::t('easyii', 'Save'), ['class' => 'btn btn-primary']);
?>
<?php
$form->end();
示例13:
<div class="login-box-body">
<?php
$form = ActiveForm::begin(['id' => 'login-form']);
?>
<div class="body">
<?php
echo $form->field($model, 'identity');
?>
<?php
echo $form->field($model, 'password')->passwordInput();
?>
<?php
echo $form->field($model, 'rememberMe')->checkbox(['class' => 'simple']);
?>
</div>
<div class="footer">
<?php
echo Html::submitButton('Sign me in', ['class' => 'btn btn-primary btn-flat btn-block']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
示例14:
/** @var $this \yii\web\View */
/** @var $model \app\modules\guest\models\forms\ResetPasswordRequestForm */
use yii\bootstrap\Html;
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;
use yii\helpers\Url;
$this->title = Yii::t('guest', 'Reset password');
?>
<div class="form-page">
<h2><?php
echo Html::encode($this->title);
?>
</h2>
<?php
$form = ActiveForm::begin(['id' => 'reset-password-request-form', 'enableAjaxValidation' => true, 'fieldConfig' => ['inputOptions' => ['autocomplete' => 'off'], 'errorOptions' => ['encode' => false]]]);
?>
<?php
echo $form->field($model, 'email')->textInput(['autofocus' => true]);
?>
<?php
echo $form->field($model, 'captcha')->widget(Captcha::className(), ['captchaAction' => Url::toRoute('/common/common/captcha'), 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'template' => '{image} <a href="#" class="captcha-refresh-link" title="' . Yii::t('guest', 'Refresh digits') . '"><span class="glyphicon glyphicon-refresh"></span></a> {input}']);
?>
<?php
echo Html::submitButton(Yii::t('guest', 'Reset'), ['class' => 'btn btn-primary']);
?>
<?php
ActiveForm::end();
?>
</div>
示例15: count
}
?>
<div class="row">
<div class="col-md-3 col-sm-12">
<div class="box box-solid">
<div class="box-body">
<?php
$form = ActiveForm::begin(['id' => 'whois-lookup', 'action' => Url::toRoute('whois/index'), 'method' => 'get', 'options' => ['data-pjax' => false], 'fieldConfig' => ['template' => "{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}"]]);
?>
<?php
echo $form->field($model, 'domain')->textInput(['placeholder' => Yii::t('hipanel:domain', 'Domain name'), 'class' => 'form-control', 'name' => 'domain', 'value' => $model->getDomainAsUtf8()]);
?>
<?php
echo Html::submitButton('<i class="fa fa-search"></i> ' . Yii::t('hipanel:domain', 'Search'), ['class' => 'btn btn-info btn-flat btn-block xs-mb-10']);
?>
<?php
ActiveForm::end();
?>
<div class="bg-warning md-mt-10 xs-mb-10" style="padding: 5px 7px">
<span class="text-bold"><?php
echo Yii::t('hipanel:domain', 'Available zones');
?>
:</span><br>
<?php
echo ArraySpoiler::widget(['data' => $availableZones, 'visibleCount' => count($availableZones)]);
?>
</div>
<p class="md-mt-20 text-justify">
<?php