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
파일 보기 프로젝트 열기: yiisoft/yii2-jui

공개 프로퍼티들

프로퍼티 타입 설명
$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