PHP Class kartik\tree\TreeViewInput

Since: 1.0
Author: Kartik Visweswaran ([email protected])
Inheritance: extends TreeView
Afficher le fichier Open project: kartik-v/yii2-tree-manager Class Usage Examples

Méthodes publiques

Свойство Type Description
$asDropdown whether to show the input as a dropdown select. If set to false, it will display directly the tree view selector widget. Defaults to true. The BootstrapPluginAsset will automatically be loaded if this is set to true. Defaults to true.
$attribute the model attribute that this widget is associated with.
$autoCloseOnSelect whether to autoclose the dropdown on input selection when asDropdown is true. Defaults to true.
$dropdownConfig the configuration of the tree view dropdown. The following configuration options are available: - input: array the HTML attributes for the dropdown input container which displays the selected tree items. The following special options are available: - placeholder: string, defaults to Select... - dropdown: array, the HTML attributes for the dropdown tree view menu. - options: array, the HTML attributes for the wrapper container - caret: string, the markup for rendering the dropdown indicator for up and down. Defaults to TreeViewInput::CARET.
$model the data model that this widget is associated with.
$name the input name. This must be set if [[model]] and [[attribute]] are not set.
$options the HTML attributes for the input that will store the selected nodes for the widget
$showToolbar whether to show the toolbar in the footer. Defaults to false.
$value the input value.

Méthodes publiques

Méthode Description
getInput ( ) : string Generates the hidden input for storage
registerInputAssets ( ) Registers assets for TreeViewInput
renderToolbar ( ) : string Renders the markup for the button actions toolbar
renderWidget ( )
run ( )

Méthodes protégées

Méthode Description
hasModel ( ) : boolean
initDropdown ( ) Initialize tree dropdown menu settings and options
initTreeView ( )
renderDropdown ( string $content ) : string Generates the dropdown tree menu

Method Details

getInput() public méthode

Generates the hidden input for storage
public getInput ( ) : string
Résultat string

hasModel() protected méthode

protected hasModel ( ) : boolean
Résultat boolean whether this widget is associated with a data model.

initDropdown() protected méthode

Initialize tree dropdown menu settings and options
protected initDropdown ( )

initTreeView() protected méthode

protected initTreeView ( )

registerInputAssets() public méthode

Registers assets for TreeViewInput
public registerInputAssets ( )

renderDropdown() protected méthode

Generates the dropdown tree menu
protected renderDropdown ( string $content ) : string
$content string the content to be embedded in the dropdown menu
Résultat string

renderToolbar() public méthode

Renders the markup for the button actions toolbar
public renderToolbar ( ) : string
Résultat string

renderWidget() public méthode

public renderWidget ( )

run() public méthode

public run ( )

Property Details

$asDropdown public_oe property

whether to show the input as a dropdown select. If set to false, it will display directly the tree view selector widget. Defaults to true. The BootstrapPluginAsset will automatically be loaded if this is set to true. Defaults to true.
public $asDropdown

$attribute public_oe property

the model attribute that this widget is associated with.
public $attribute

$autoCloseOnSelect public_oe property

whether to autoclose the dropdown on input selection when asDropdown is true. Defaults to true.
public $autoCloseOnSelect

$dropdownConfig public_oe property

the configuration of the tree view dropdown. The following configuration options are available: - input: array the HTML attributes for the dropdown input container which displays the selected tree items. The following special options are available: - placeholder: string, defaults to Select... - dropdown: array, the HTML attributes for the dropdown tree view menu. - options: array, the HTML attributes for the wrapper container - caret: string, the markup for rendering the dropdown indicator for up and down. Defaults to TreeViewInput::CARET.
public $dropdownConfig

$model public_oe property

the data model that this widget is associated with.
public $model

$name public_oe property

the input name. This must be set if [[model]] and [[attribute]] are not set.
public $name

$options public_oe property

the HTML attributes for the input that will store the selected nodes for the widget
public $options

$showToolbar public_oe property

whether to show the toolbar in the footer. Defaults to false.
public $showToolbar

$value public_oe property

the input value.
public $value