Yii generates breadcrumbs on every view page via Gii. I would like to know a way to programmatically disable all breadcru开发者_如何学Pythonmbs on every view.
Otherwise, I think the css way would work. But I feel like a waste to generate code on the server only to hide them on the client side.
.breadcrumbs{
display:none
}
I looked at detachbehavior, and failed to find useful example. Is it even related? Please kindly advice. Thanks
Breadcrumbs exist in the main.php viewfile. This file is under /protected/views/layouts/main.php.
If you eliminate the line where it says:
<?php $this->widget('zii.widgets.CBreadcrumbs', array(
'links'=>$this->breadcrumbs,
)); ?><!-- breadcrumbs -->
You shouldn't see it in any other view unless you explicitly put it there.
you can also copy the gii templates and change the view files.
from framework/gii/generators/crud/templates/default to protected/gii/generators/crud/templates/default
and when you generate the crud only select the new templates
精彩评论