public function registerJs() { $id = $this->options['id']; $options = Json::htmlEncode($this->clientOptions); $user = Json::htmlEncode($this->user); $contact = Json::htmlEncode($this->contact); $view = $this->getView(); MessageAsset::register($view); $view->registerJs("jQuery('#{$id}').yiiSimpleChatMessages({$user},{$contact},{$options});"); }
public function registerJs() { $id = $this->options['id']; if (!isset($this->clientOptions['selector'])) { $this->clientOptions['selector'] = '.' . strstr($this->itemOptions['class'], ' ', true); } $this->clientOptions['form'] = '#' . $this->formOptions['id']; $options = Json::htmlEncode($this->clientOptions); $user = Json::htmlEncode($this->user); $contact = Json::htmlEncode($this->contact); $view = $this->getView(); MessageAsset::register($view); $view->registerJs("jQuery('#{$id}').simpleChatMessages({$user},{$contact},{$options});"); }