dosamigos\fileupload\FileUpload::registerClientScript PHP Method

registerClientScript() public method

Registers required script for the plugin to work as jQuery File Uploader
    public function registerClientScript()
    {
        $view = $this->getView();
        if ($this->plus) {
            FileUploadPlusAsset::register($view);
        } else {
            FileUploadAsset::register($view);
        }
        $options = Json::encode($this->clientOptions);
        $id = $this->options['id'];
        $js[] = ";jQuery('#{$id}').fileupload({$options});";
        if (!empty($this->clientEvents)) {
            foreach ($this->clientEvents as $event => $handler) {
                $js[] = "jQuery('#{$id}').on('{$event}', {$handler});";
            }
        }
        $view->registerJs(implode("\n", $js));
    }