LimeSurvey API - Master branch

TbWidget extends CBehavior
in package

Bootstrap widget behavior.

Table of Contents

Properties

$counter  : int
$owner  : mixed
$_assetsUrl  : mixed
$_clientScript  : mixed

Methods

copyId()  : mixed
Copies the id to the widget HTML attributes or vise versa.
publishAssets()  : string
Publishes an asset path.
registerCssFile()  : mixed
Registers a CSS file.
registerEvents()  : mixed
Registers plugin events with the client script.
registerPlugin()  : mixed
Registers the given plugin with the client script.
registerScriptFile()  : mixed
Registers a JavaScript file.
resolveId()  : string
Returns the widget id and copies it to HTML attributes or vice versa.
resolveScriptVersion()  : string
Returns the name of the correct script file to use.
getClientScript()  : CClientScript
Returns the client script component.

Properties

$counter

public static int $counter = 0

Static counter for generating unique script IDs.

$_clientScript

private mixed $_clientScript

Methods

copyId()

Copies the id to the widget HTML attributes or vise versa.

public copyId() : mixed
Tags
deprecated

by TbWidget::resolveId

publishAssets()

Publishes an asset path.

public publishAssets(string $path[, bool $forceCopy = false ]) : string
Parameters
$path : string

the assets path.

$forceCopy : bool = false

whether we should copy the asset files even if they are already published before.

Tags
throws
CException

if the asset manager cannot be located.

Return values
string

the url.

registerCssFile()

Registers a CSS file.

public registerCssFile(string $url[, string $media = '' ]) : mixed
Parameters
$url : string

URL of the CSS file.

$media : string = ''

media that the CSS file should be applied to.

registerEvents()

Registers plugin events with the client script.

public registerEvents(string $selector, array<string|int, string> $events[, int $position = CClientScript::POS_END ]) : mixed
Parameters
$selector : string

the CSS selector.

$events : array<string|int, string>

the JavaScript event configuration (name=>handler).

$position : int = CClientScript::POS_END

the position of the JavaScript code.

registerPlugin()

Registers the given plugin with the client script.

public registerPlugin(string $name, string $selector[, array<string|int, mixed> $options = array() ][, int $position = CClientScript::POS_END ]) : mixed
Parameters
$name : string

the plugin name.

$selector : string

the CSS selector.

$options : array<string|int, mixed> = array()

the JavaScript options for the plugin.

$position : int = CClientScript::POS_END

the position of the JavaScript code.

registerScriptFile()

Registers a JavaScript file.

public registerScriptFile(string $url[, int $position = null ]) : mixed
Parameters
$url : string

URL of the javascript file.

$position : int = null

the position of the JavaScript code.

resolveId()

Returns the widget id and copies it to HTML attributes or vice versa.

public resolveId([string $id = null ]) : string
Parameters
$id : string = null

the widget id.

Return values
string

the widget id.

resolveScriptVersion()

Returns the name of the correct script file to use.

public resolveScriptVersion(string $filename[, bool $minified = false ]) : string
Parameters
$filename : string

the base file name.

$minified : bool = false

whether to include the minified version (defaults to false).

Return values
string

the full filename.

getClientScript()

Returns the client script component.

protected getClientScript() : CClientScript
Return values
CClientScript

the component.


        
On this page

Search results