Browse Source

安装kartik-tabx,处理bootstrap 3.x和4.x的版本转换问题

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
097c4da942
  1. 3
      composer.json
  2. 31
      vendor/antgoods/goods/src/views/goods/create.php

3
composer.json

@ -15,7 +15,8 @@
"yiisoft/yii2": "~2.0.14", "yiisoft/yii2": "~2.0.14",
"yiisoft/yii2-bootstrap4": "~2.0.6", "yiisoft/yii2-bootstrap4": "~2.0.6",
"yiisoft/yii2-redis": "^2.0.0", "yiisoft/yii2-redis": "^2.0.0",
"moonlandsoft/yii2-phpexcel": "*"
"moonlandsoft/yii2-phpexcel": "*",
"kartik-v/yii2-tabs-x": "^1.2@dev"
}, },
"repositories": { "repositories": {
"asset_packagist": { "asset_packagist": {

31
vendor/antgoods/goods/src/views/goods/create.php

@ -1,6 +1,8 @@
<?php <?php
use yii\helpers\Html;
use kartik\tabs\TabsX;
use yii\widgets\ActiveForm;
use yii\bootstrap4\Html;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model antgoods\goods\models\ars\Goods */ /* @var $model antgoods\goods\models\ars\Goods */
@ -8,11 +10,32 @@ use yii\helpers\Html;
$this->title = '创建商品'; $this->title = '创建商品';
$this->params['breadcrumbs'][] = ['label' => '商品列表', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => '商品列表', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
Yii::$app->params['bsVersion'] = '4.x';
?> ?>
<div class="goods-create"> <div class="goods-create">
<?= $this->render('_form', [
'model' => $model,
]) ?>
<?php
$form = ActiveForm::begin();
echo TabsX::widget([
'bordered' => true,
'position' => TabsX::POS_ABOVE,
'encodeLabels' => false,
]);
?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
</div>
<?php ActiveForm::end(); ?>
<?php
// $this->render('_form', [
// 'model' => $model,
// ])
?>
</div> </div>
Loading…
Cancel
Save