本文整理汇总了PHP中kartik\form\ActiveForm::end方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveForm::end方法的具体用法?PHP ActiveForm::end怎么用?PHP ActiveForm::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\form\ActiveForm
的用法示例。
在下文中一共展示了ActiveForm::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?= $form->field($model, 'head_picture')->label(Yii::t('app', 'Upload Head Picture'))->widget(FileInput::classname(), [
'pluginOptions' => [
'uploadUrl' => Url::to(['/user/upload-head-pic']),
'uploadAsync' => false,
'allowedPreviewTypes' => ['image'],
'allowedFileExtensions' => ['png', 'jpg', 'jpeg'],
'maxFileCount' => 1,
'maxFileSize' => 1000,
'uploadExtraData' => [
'_csrf' => Yii::$app->request->csrfToken,
'User[id]' => $model->id,
]
]
]); ?>
<?php ActiveForm::end(); ?>
</div>
<div class="col-lg-2 col-lg-offset-5 col-md-2 col-md-offset-5 col-sm-2 col-sm-offset-2 profile-save">
<button class="btn btn-info" onclick="profileSave()" id="profile-save-btn"><span class="fa fa-spinner fa-pulse" style="display:none"></span>保存</button>
</div>
</div>
<!-- <div class="mengceng">
<span class="fa fa-refresh fa-spin fa-3x gif"></span>
</div> -->
<script type="text/javascript">
示例2:
<?php
echo Html::submitButton(Yii::t('setup', 'Test connection'), ['class' => 'btn btn-default pull-left', 'name' => 'test']);
?>
<?php
if ($connectionOk) {
?>
<?php
echo Html::submitButton(Yii::t('setup', 'Save and continue'), ['class' => 'btn btn-primary pull-right', 'name' => 'save']);
?>
<?php
}
?>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
<?php
$advancedOptions = Yii::t('setup', 'Advanced options');
$js = <<<JS
\$(document).ready(function(){
\$("#advancedOptions").hide();
\$('#toogleAdvancedOptions').click(function( e ){
e.preventDefault(); // If you use anchors
var SH = this.SH^=1; // "Simple toggler"
\$(this).html(SH?'▼ {$advancedOptions}':'▶ {$advancedOptions}')
.css({backgroundPosition:'0 '+ (SH?-18:0) +'px'})
示例3: loading
<?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]));
?>
示例4: run
/**
* @inheritdoc
*/
public function run()
{
if (empty($this->options['id'])) {
$this->options['id'] = $this->getId();
}
if (!isset($this->formOptions['type'])) {
$this->formOptions['type'] = ActiveForm::TYPE_VERTICAL;
}
if (!isset($this->formOptions['fieldConfig'])) {
$this->formOptions['fieldConfig'] = ['autoPlaceholder' => true];
}
if (!isset($this->template)) {
$this->template = "<legend>{$this->title}</legend>\n{fields}\n{footer}";
}
if (!isset($this->footerTemplate)) {
$this->footerTemplate = <<<HTML
<div class="row">
<div class="col-sm-6 text-left">
{left}
</div>
<div class="col-sm-6 text-right">
{right}
</div>
</div>
HTML;
}
$this->_form = ActiveForm::begin($this->formOptions);
$options = ['model' => $this->model, 'form' => $this->_form, 'attributes' => $this->attributes] + $this->options;
echo strtr($this->template, ['{fields}' => Form::widget($options), '{footer}' => $this->renderFooter()]);
ActiveForm::end();
}