PHP Класс yii\jui\Selectable

For example: php echo Selectable::widget([ 'items' => [ 'Item 1', [ 'content' => 'Item2', ], [ 'content' => 'Item3', 'options' => [ 'tag' => 'li', ], ], ], 'options' => [ 'tag' => 'ul', ], 'itemOptions' => [ 'tag' => 'li', ], 'clientOptions' => [ 'tolerance' => 'fit', ], ]); Selectable in begin mode. php Selectable::begin([ 'clientOptions' => [ 'filter' => 'my-selectable-item', 'tolerance' => 'touch', ], ]);
  • Item 1
  • Item 2
  • Item 3
  • Item 4
Another item
php Selectable::end();
См. также: http://api.jqueryui.com/selectable/
С версии: 2.0
Автор: Alexander Kochetov ([email protected])
Наследование: extends yii\jui\Widget
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$itemOptions 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.
$items list of selectable items. Each item can be a string representing the item content or an array of the following structure: ~~~ [ 'content' => 'item content', the HTML attributes of the item container tag. This will overwrite "itemOptions". 'options' => [], ] ~~~
$mode the mode used to render the widget.
$options the HTML attributes for the widget container tag. The following special options are recognized: - tag: string, defaults to "ul", the tag name of the container tag of this widget.

Открытые методы

Метод Описание
begin ( array $config = [] ) : static Begins a widget.
init ( ) Initializes the widget.
renderItems ( ) : string Renders selectable items as specified on [[items]].
run ( ) Renders the widget.

Описание методов

begin() публичный статический Метод

This method creates an instance of the calling class setting the MODE_BEGIN mode. Any item between Selectable::begin and [[end()]] which match the filter attribute, will be selectable. It will apply the configuration to the created instance. A matching [[end()]] call should be called later. As some widgets may use output buffering, the [[end()]] call should be made in the same view to avoid breaking the nesting of output buffers.
См. также: end()
public static begin ( array $config = [] ) : static
$config array name-value pairs that will be used to initialize the object properties
Результат static the newly created widget instance

init() публичный Метод

Initializes the widget.
public init ( )

renderItems() публичный Метод

Renders selectable items as specified on [[items]].
public renderItems ( ) : string
Результат string the rendering result.

run() публичный Метод

Renders the widget.
public run ( )

Описание свойств

$itemOptions публичное свойство

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.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $itemOptions

$items публичное свойство

list of selectable items. Each item can be a string representing the item content or an array of the following structure: ~~~ [ 'content' => 'item content', the HTML attributes of the item container tag. This will overwrite "itemOptions". 'options' => [], ] ~~~
public $items

$mode публичное свойство

the mode used to render the widget.
public $mode

$options публичное свойство

the HTML attributes for the widget container tag. The following special options are recognized: - tag: string, defaults to "ul", the tag name of the container tag of this widget.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $options