Class chofoteddy\wizard\Wizard

Inheritancechofoteddy\wizard\Wizard » yii\bootstrap\Widget

Wizard renders a wizard bootstrap javascript component.

For example:

echo Wizard::widget([
    
'items' => [
        
// equivalent to the above
        
[
            
'label' => 'Collapsible Group Item #1',
            
'content' => 'Anim pariatur cliche...',
            
// open its content by default
            
'contentOptions' => ['class' => 'in']
        ],
        
// another wizard step
        
[
            
'label' => 'Collapsible Group Item #1',
            
'content' => 'Anim pariatur cliche...',
            
'contentOptions' => [...],
            
'options' => [...],
        ],
        
// short cut to label => content
        
'Finished' => 'Thanks for filling your information'
    
]
]);

See also http://vadimg.com/twitter-bootstrap-wizard-example/.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$encodeLabels boolean Whether the labels for header items should be HTML-encoded. chofoteddy\wizard\Wizard
$headerOptions array List of HTML attributes for the header container tags. chofoteddy\wizard\Wizard
$itemOptions array List of HTML attributes for the item container tags. chofoteddy\wizard\Wizard
$items array List of groups in the wizard widget. chofoteddy\wizard\Wizard
$labelOptions array List of HTML attributes for the item container tags. chofoteddy\wizard\Wizard
$linkOptions array List of HTML attributes for the tab header link tags. chofoteddy\wizard\Wizard
$navOptions array Options to get passed to the \yii\bootstrap\Nav widget chofoteddy\wizard\Wizard

Public Methods

Hide inherited methods

MethodDescriptionDefined By
init() chofoteddy\wizard\Wizard
renderItems() Renders wizard items as specified on $items. chofoteddy\wizard\Wizard
run() chofoteddy\wizard\Wizard

Property Details

$encodeLabels public property

Whether the labels for header items should be HTML-encoded.

public boolean $encodeLabels true
$headerOptions public property

List of HTML attributes for the header container tags. The following special options are recognized:

  • tag: string, defaults to "ul", the tag name of the item container tags.

See also \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.

public array $headerOptions = []
$itemOptions public property

List of HTML attributes for the item container tags. This will be overwritten by the "options" set in individual $items. The following special options are recognized:

  • tag: string, defaults to "div", the tag name of the item container tags.

See also \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.

public array $itemOptions = []
$items public property

List of groups in the wizard widget. Each array element represents a single group with the following structure:

  • label: string, required, the group header label.
  • url: string|array, optional, an external URL. When this is specified, clicking on this tab will bring
  • encode: boolean, optional, whether this label should be HTML-encoded. This param will override global $this->encodeLabels param.
  • content: array|string|object, required, the content (HTML) of the group
  • options: array, optional, the HTML attributes of the group
  • contentOptions: optional, the HTML attributes of the group's content
  • visible: boolean, optional, whether the item should be visible or not. Defaults to true.
public array $items = []
$labelOptions public property

List of HTML attributes for the item container tags. This will be overwritten by the "options" set in individual $items. The following special options are recognized:

  • tag: string, defaults to "li", the tag name of the item container tags.

See also \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.

public array $labelOptions = []
$linkOptions public property

List of HTML attributes for the tab header link tags. This will be overwritten by the "linkOptions" set in individual $items.

See also \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.

public array $linkOptions = []
$navOptions public property

Options to get passed to the \yii\bootstrap\Nav widget

See also \yii\bootstrap\Widget::$options for details.

public array $navOptions = []

Method Details

init() public method

public void init ( )
renderItems() public method

Renders wizard items as specified on $items.

public string renderItems ( )
return string

The rendering result.

throws \chofoteddy\wizard\InvalidConfigException.
run() public method

public void run ( )