Php yiii2面包屑小部件下一行如何避免

问题描述 投票:0回答:2

我正在开发yii2 Web应用程序,并且我想在yii2中使用Breadcrumb小部件。当我使用面包屑小部件时,它会跳一行。

我的代码:

<?= "Label : ".Breadcrumbs::widget([
                                      'homeLink' => [ 
                                        'label' => Yii::t('yii', 'Car'),
                                        'url' => "index.php?r=car/index",
                                      ],
                                      'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],

                                    ]) 
                                    ?>

输出:


Label :

Cars > Audi > Audi A1



我希望面包屑来


Label : Cars > Audi > Audi A1


我该怎么做?

php yii2 breadcrumbs
2个回答
0
投票

如果使用引导程序:

<div class="d-flex flex-row">
   <?= "Label : ".Breadcrumbs::widget([
                                      'homeLink' => [ 
                                        'label' => Yii::t('yii', 'Car'),
                                        'url' => "index.php?r=car/index",
                                      ],
                                      'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],

                                    ]) 
    ?>
</div>

0
投票

您可以执行的快速修复:

请更改为:

<?=
    "Label : ".Breadcrumbs::widget([
        'homeLink' => [ 
            'label' => Yii::t('yii', 'Car'),
            'url' => "index.php?r=car/index",
        ],
        'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
    ])
?>

收件人:

<?=
    Breadcrumbs::widget([
        'homeLink' => [ 
            'label' => Yii::t('yii', 'Label : Car'),
            'url' => "index.php?r=car/index",
        ],
        'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
    ])
?>
© www.soinside.com 2019 - 2024. All rights reserved.