I have breadcrumbs such as Home > Instance > Action
in all my view pages. How can I remove the 'Home' link from all the breadcrumbs?
$this->breadcrumbs=array(
'Keypairs'=>array('admin'),
'Manage',
);
This can be done by setting the homeLink
property to false
, in your CBreadcrumbs widget initialization. This is usually done in a layout file.
In the default Yii app, in protected/views/layouts/main.php:
<?php if(isset($this->breadcrumbs)):?>
<?php $this->widget('zii.widgets.CBreadcrumbs', array(
'links'=>$this->breadcrumbs,
'homeLink'=>false // add this line
)); ?><!-- breadcrumbs -->
<?php endif?>
in layouts/main.php add 'homeLink' => false
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs'])? $this->params['breadcrumbs'] : [],
'homeLink' => false
]) ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With