Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CBaseListView
  • CBreadcrumbs
  • CDetailView
  • CListView
  • CMenu
  • CPortlet
  • MobileActivityFeedListView
  • RecordIndexListView
  • TopicsListView
  • Overview
  • Package
  • Class
  • Tree

Class CBreadcrumbs

CBreadcrumbs displays a list of links indicating the position of the current page in the whole website.

For example, breadcrumbs like "Home > Sample Post > Edit" means the user is viewing an edit page for the "Sample Post". He can click on "Sample Post" to view that page, or he can click on "Home" to return to the homepage.

To use CBreadcrumbs, one usually needs to configure its CBreadcrumbs::$links property, which specifies the links to be displayed. For example,

$this->widget('zii.widgets.CBreadcrumbs', array(
    'links'=>array(
        'Sample post'=>array('post/view', 'id'=>12),
        'Edit',
    ),
));

Because breadcrumbs usually appears in nearly every page of a website, the widget is better to be placed in a layout view. One can define a property "breadcrumbs" in the base controller class and assign it to the widget in the layout, like the following:

$this->widget('zii.widgets.CBreadcrumbs', array(
    'links'=>$this->breadcrumbs,
));

Then, in each view script, one only needs to assign the "breadcrumbs" property as needed.

CComponent
Extended by CBaseController
Extended by CWidget
Extended by CBreadcrumbs
Package: zii\widgets
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.1
Located at x2engine/framework/zii/widgets/CBreadcrumbs.php
Methods summary
public
# run( )

Renders the content of the portlet.

Renders the content of the portlet.

Overrides

CWidget::run()
Methods inherited from CWidget
__construct(), actions(), getController(), getId(), getOwner(), getViewFile(), getViewPath(), init(), render(), setId()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal(), widget()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public string $tagName 'div'
#

the tag name for the breadcrumbs container tag. Defaults to 'div'.

the tag name for the breadcrumbs container tag. Defaults to 'div'.

public array $htmlOptions array('class'=>'breadcrumbs')
#

the HTML attributes for the breadcrumbs container tag.

the HTML attributes for the breadcrumbs container tag.

public boolean $encodeLabel true
#

whether to HTML encode the link labels. Defaults to true.

whether to HTML encode the link labels. Defaults to true.

public string $homeLink
#

the first hyperlink in the breadcrumbs (called home link). If this property is not set, it defaults to a link pointing to CWebApplication::homeUrl with label 'Home'. If this property is false, the home link will not be rendered.

the first hyperlink in the breadcrumbs (called home link). If this property is not set, it defaults to a link pointing to CWebApplication::homeUrl with label 'Home'. If this property is false, the home link will not be rendered.

public array $links array()
#

list of hyperlinks to appear in the breadcrumbs. If this property is empty, the widget will not render anything. Each key-value pair in the array will be used to generate a hyperlink by calling CHtml::link(key, value). For this reason, the key refers to the label of the link while the value can be a string or an array (used to create a URL). For more details, please refer to CHtml::link(). If an element's key is an integer, it means the element will be rendered as a label only (meaning the current page).

The following example will generate breadcrumbs as "Home > Sample post > Edit", where "Home" points to the homepage, "Sample post" points to the "index.php?r=post/view&id=12" page, and "Edit" is a label. Note that the "Home" link is specified via CBreadcrumbs::$homeLink separately.

array(
    'Sample post'=>array('post/view', 'id'=>12),
    'Edit',
)

list of hyperlinks to appear in the breadcrumbs. If this property is empty, the widget will not render anything. Each key-value pair in the array will be used to generate a hyperlink by calling CHtml::link(key, value). For this reason, the key refers to the label of the link while the value can be a string or an array (used to create a URL). For more details, please refer to CHtml::link(). If an element's key is an integer, it means the element will be rendered as a label only (meaning the current page).

The following example will generate breadcrumbs as "Home > Sample post > Edit", where "Home" points to the homepage, "Sample post" points to the "index.php?r=post/view&id=12" page, and "Edit" is a label. Note that the "Home" link is specified via CBreadcrumbs::$homeLink separately.

array(
    'Sample post'=>array('post/view', 'id'=>12),
    'Edit',
)
public string $activeLinkTemplate '<a href="{url}">{label}</a>'
#

String, specifies how each active item is rendered. Defaults to "{label}", where "{label}" will be replaced by the corresponding item label while "{url}" will be replaced by the URL of the item.

String, specifies how each active item is rendered. Defaults to "{label}", where "{label}" will be replaced by the corresponding item label while "{url}" will be replaced by the URL of the item.

Since

1.1.11
public string $inactiveLinkTemplate '<span>{label}</span>'
#

String, specifies how each inactive item is rendered. Defaults to "<span>{label}</span>", where "{label}" will be replaced by the corresponding item label. Note that inactive template does not have "{url}" parameter.

String, specifies how each inactive item is rendered. Defaults to "<span>{label}</span>", where "{label}" will be replaced by the corresponding item label. Note that inactive template does not have "{url}" parameter.

Since

1.1.11
public string $separator ' &raquo; '
#

the separator between links in the breadcrumbs. Defaults to ' » '.

the separator between links in the breadcrumbs. Defaults to ' » '.

Properties inherited from CWidget
$actionPrefix, $skin
Magic properties inherited from CWidget
$controller, $id, $owner, $viewPath
API documentation generated by ApiGen 2.8.0