找不到错误类别'yii \ boostrap \ Modal'

时间:2019-12-05 09:47:24

标签: yii2 yii2-advanced-app

我想使用引导弹出窗口,但我使用的是这个网址https://www.yiiframework.com/extension/yiisoft/yii2-bootstrap/doc/api/2.0/yii-bootstrap-modal,但是当我使用类'yii \ boostrap \ Modal'时,它给我错误Error 找不到类“ yii \ boostrap \ Modal” 我的索引页代码如下,并且在使用Modal之前运行良好。

<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\boostrap\Modal;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel common\models\BillsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Bills';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="bills-index">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::button('Create Bills',  ['value' => 'index.php?r=bills/create', 'id'=>'modalBUtton', 'class' => 'btn btn-success']) ?>
    </p>

    <?php Modal::begin([
        'header' => "<b>". $this->title." </b> ",
        'id' => "modal",
        'size' => "modal-lg",
    ]);
    echo "<div id='modalCpntent'></div>";
    Modal::end();
    ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

           // 'id',
            'company1.company_name',
            'entityName',

            'hording1.name',

            ['class' => 'yii\grid\ActionColumn',
             'header' => 'Actions',
          'headerOptions' => ['style' => 'color:#337ab7'],
          'template' => '{view}{update}',
          'buttons' => [
            'view' => function ($url, $model) {
                return Html::a('<button type="button" class="btn btn-outline-primary btn-sm">
<i class="fa fa-eye"></i>&nbsp; </button>', $url, [
                            'title' => Yii::t('app', 'Record-view'),
                ]);
            },

            'update' => function ($url, $model) {
                return Html::a('<button type="button" class="btn btn-outline-secondary btn-sm">
<i class="fa fa-pencil-square-o"></i>&nbsp;</button>', $url, [
                            'title' => Yii::t('app', 'Record-update'),
                ]);
            },
          ],   
        ],
        ],
    ]); ?>


</div>

1 个答案:

答案 0 :(得分:0)

使用yii \ bootstrap \ Modal是我的错字错误;在那儿。