# RegisterClientScript

> Registers per-widget client settings and the optional remote loader.

[API reference](/docs/api/index.md) › [Selectize](/docs/extensions/selectize/reference/index.md) › RegisterClientScript

| trait | `yii2\extensions\selectize\RegisterClientScript` |
| --- | --- |
| Source | [`src/RegisterClientScript.php`](https://github.com/yii2-extensions/selectize/blob/main/src/RegisterClientScript.php#L14) |

Used by 1 type:

- [`Selectize`](/docs/extensions/selectize/reference/selectize/index.md)

Registers per-widget client settings and the optional remote loader.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-clientOptions"></span>`$clientOptions` | `array` | The client options for the Selectize widget. Default: `[]`. | `RegisterClientScript` |
| <span id="property-loadUrl"></span>`$loadUrl` | `array` | The URL for loading remote data for the Selectize widget. Default: `[]`. | `RegisterClientScript` |
| <span id="property-queryParam"></span>`$queryParam` | `string` | Name of the request parameter that carries the search text when loading remote data. Default: `'query'`. | `RegisterClientScript` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`registerClientScript()`](#method-registerClientScript) | Registers the integration asset and initializes Selectize on the widget input. | `RegisterClientScript` |

## Method details

### registerClientScript() <span id="method-registerClientScript"></span>

```php
public function registerClientScript(): void
```

Registers the integration asset and initializes Selectize on the widget input.

When [`$loadUrl`](/docs/extensions/selectize/reference/registerclientscript/index.md#property-loadUrl) is not empty, adds a `load` callback that requests remote data with the search text.