Phundament App Class Reference
  • Package
  • Class
  • Tree

Packages

  • bootstrap
    • widgets
      • input
  • Image
  • None
  • p3admin
  • p3extensions
    • behaviors
    • commands
    • components
    • helpers
    • widgets
  • p3media
    • actions
    • controllers
    • models
  • p3pages
    • models
  • p3widgets
    • components
    • models
  • PHP
  • system
    • db
      • ar
    • gii
    • web
      • auth
      • helpers
      • widgets
  • yiiext
    • widgets
      • fancybox
      • lipsum
  • zii
    • widgets
      • grid

Classes

  • EditableDetailView
  • TbBaseMenu

Class TbBaseMenu

CMenu displays a multi-level menu using nested HTML lists.

The main property of CMenu is CMenu::$items, which specifies the possible items in the menu. A menu item has three main properties: visible, active and items. The "visible" property specifies whether the menu item is currently visible. The "active" property specifies whether the menu item is currently selected. And the "items" property specifies the child menu items.

The following example shows how to use CMenu:

$this->widget('zii.widgets.CMenu', array(
    'items'=>array(
        // Important: you need to specify url as 'controller/action',
        // not just as 'controller' even if default acion is used.
        array('label'=>'Home', 'url'=>array('site/index')),
        // 'Products' menu item will be selected no matter which tag parameter value is since it's not specified.
        array('label'=>'Products', 'url'=>array('product/index'), 'items'=>array(
            array('label'=>'New Arrivals', 'url'=>array('product/new', 'tag'=>'new')),
            array('label'=>'Most Popular', 'url'=>array('product/index', 'tag'=>'popular')),
        )),
        array('label'=>'Login', 'url'=>array('site/login'), 'visible'=>Yii::app()->user->isGuest),
    ),
));
CComponent
Extended by CBaseController
Extended by CWidget
Extended by CMenu
Extended by TbBaseMenu

Direct known subclasses

TbDropdown, TbMenu

Abstract
Package: zii\widgets
Copyright: Copyright © Christoffer Niska 2012-
License: New BSD License
Author: Jonah Turnquist <poppitypop@gmail.com>
Author: Qiang Xue <qiang.xue@gmail.com>
Version: $Id$
Since: 1.1
Located at crisu83/yii-bootstrap/widgets/TbBaseMenu.php

Methods summary

abstract public string
# getDividerCssClass( )

Returns the divider css class.

Returns the divider css class.

Returns

string
the class name
abstract public string
# getDropdownCssClass( )

Returns the dropdown css class.

Returns the dropdown css class.

Returns

string
the class name
abstract public boolean
# isVertical( )

Returns whether this is a vertical menu.

Returns whether this is a vertical menu.

Returns

boolean
the result
protected
# renderMenu( array $items )

Renders the menu items.

Renders the menu items.

Parameters

$items
array
$items menu items. Each menu item will be an array with at least two elements: 'label' and 'active'. It may have three other optional elements: 'items', 'linkOptions' and 'itemOptions'.

Overrides

CMenu::renderMenu
protected string
# renderMenuItem( array $item )

Renders the content of a menu item. Note that the container and the sub-menus are not rendered here.

Renders the content of a menu item. Note that the container and the sub-menus are not rendered here.

Parameters

$item
array
$item the menu item to be rendered. Please see CMenu::$items on what data might be in the item.

Returns

string
the rendered item

Overrides

CMenu::renderMenuItem
protected array
# normalizeItems( array $items, string $route, boolean & $active )

Normalizes the CMenu::$items property so that the 'active' state is properly identified for every menu item.

Normalizes the CMenu::$items property so that the 'active' state is properly identified for every menu item.

Parameters

$items
array
$items the items to be normalized.
$route
string
$route the route of the current request.
$active
boolean
$active whether there is an active child menu item.

Returns

array
the normalized menu items

Overrides

CMenu::normalizeItems

Methods inherited from CMenu

init(), isItemActive(), renderMenuRecursive(), run()

Methods inherited from CWidget

__construct(), actions(), getController(), getId(), getOwner(), getViewFile(), getViewPath(), 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()

Magic methods summary

Properties summary

Properties inherited from CMenu

$activateItems, $activateParents, $activeCssClass, $encodeLabel, $firstItemCssClass, $hideEmptyItems, $htmlOptions, $itemCssClass, $itemTemplate, $items, $lastItemCssClass, $linkLabelWrapper, $submenuHtmlOptions

Properties inherited from CWidget

$actionPrefix, $skin

Magic properties inherited from CWidget

$controller, $id, $owner, $viewPath

Phundament App Class Reference API documentation generated by ApiGen 2.8.0