Home made extensions for the Yii Framework.
Url is a string. No menu is set to the 'google' breadcrumb. Note that all crumbs are HTML escaped.
$this->widget('application.extensions.exbreadcrumbs.EXBreadcrumbs', array( 'links'=>array( 'google' => 'http://www.google.fr', '<end>' ), ));
In order to add a menu to a breadcrumb with a valid URL (google), you must use the special key 'url'.
$this->widget('application.extensions.exbreadcrumbs.EXBreadcrumbs', array( 'links'=>array( 'google' => array( 'url' => 'http://www.google.fr', 'menu'=>array( 'menu1'=> array('controller/routeMenu1','paramM1' => 'valueM1'), 'menu2'=> array('controller/routeMenu2','paramM2' => 'valueM2'), ) ), 'end' ), ));
Breadcrumbs links are provided as an array with the same format than the one used for zii.widgets.CBreadcrumbs.
$this->widget('application.extensions.exbreadcrumbs.EXBreadcrumbs', array( 'links'=>array( 'crumb1' => array('controller/route1','param1'=>'value1'), 'crumb2' => array('controller/route2','param2'=>'value2'), 'crumb3' ), ));
Only breadcrumb crumb1 as a menu. It is set using the special key 'menu'. This key is removed from the table before actually creating the link and thus does not appear in the URL GET parameters.
$this->widget('application.extensions.exbreadcrumbs.EXBreadcrumbs', array( 'links'=>array( 'crumb1' => array('controller/route1','param1'=>'value1', 'menu'=>array( 'menu1'=> array('controller/routeMenu1','paramM1' => 'valueM1'), 'menu2'=> array('controller/routeMenu2','paramM2' => 'valueM2'), ) ), 'crumb2' => array('controller/route2','param2'=>'value2'), 'google' => 'http://www.google.fr', 'end' ), ));
By default, the homeLink does not have any menu. To add one, use the homeMenu key. Below, only homeLink has a menu
$this->widget('application.extensions.exbreadcrumbs.EXBreadcrumbs', array( 'homeMenu'=>array( 'Home Menu1'=> array('controller/routeMenu1','paramM1' => 'valueM1'), 'Home Menu2'=> array('controller/routeMenu2','paramM2' => 'valueM2'), ), 'links'=>array( 'crumb1' => array('controller/route1','param1'=>'value1'), 'crumb2' => array('controller/route2','param2'=>'value2'), 'crumb3' ), ));
The core CBreadcrumbs widget doesn't allow to set a title attribute to a breadcrumb. With EXBreadcrumb you can set one, or any other HTML options, by using the special attribute 'htmlOptions'.
$this->widget('application.extensions.exbreadcrumbs.EXBreadcrumbs', array( 'links'=>array( 'crumb1' => array('controller/route1','param1'=>'value1', 'htmlOptions'=> array( 'title' => 'crumb 1 title' ), ), 'crumb2' => array('controller/route2','param2'=>'value2', 'htmlOptions'=> array( 'title' => 'crumb 2 title' ), ), 'crumb3' ), ));
Another feature provided by XBreadcrumb is collapsible crumbs.
$this->widget('application.extensions.exbreadcrumbs.EXBreadcrumbs', array( 'collapsible'=> true, 'collapsedWidth' => 15, 'links'=>array( 'crumb1' => array('controller/route1','param1'=>'value1', 'menu'=>array( 'menu1'=> array('controller/routeMenu1','paramM1' => 'valueM1'), 'menu2'=> array('controller/routeMenu2','paramM2' => 'valueM2'), ) ), 'crumb2' => array('controller/route2','param2'=>'value2'), 'google' => 'http://www.google.fr', 'end' ), ));
The extensions comes with a default style. You can define your own style with the 'cssFile' and 'htmlOptions' attributes. Note that in the example below, the base style xbreadcrumbs.css (that comes with the widget) is applied because the 'xbreadcrumbs' class is set. We overload this style with our own custom_xbreadcrumbs class, defined in css/xbreadcrumbs_custom_style.css.
$this->widget('application.extensions.exbreadcrumbs.EXBreadcrumbs', array( 'cssFile' => 'css/styleSample/styleSample.css', 'htmlOptions'=>array('class'=>'xbreadcrumbs xbreadcrumbs_style'), 'links'=>array( 'crumb1' => array('controller/route1','param1'=>'value1', 'menu'=>array( 'menu1'=> array('controller/routeMenu1','paramM1' => 'valueM1'), 'menu2'=> array('controller/routeMenu2','paramM2' => 'valueM2'), ) ), 'crumb2' => array('controller/route2','param2'=>'value2', 'menu'=>array( 'menu3'=> array('controller/routeMenu1','paramM1' => 'valueM1'), ) ), 'crumb3' ), ));