我正在开发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
我该怎么做?
如果使用引导程序:
<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>
您可以执行的快速修复:
请更改为:
<?=
"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'] : [],
])
?>