Пример #1
0
 /**
  * Register assets
  */
 protected function registerAssets()
 {
     $view = $this->getView();
     LinkPreviewAsset::register($view);
     $options = $this->getClientOptions();
     $view->registerJs("\$('{$this->selector}').linkPreview({$options});", $view::POS_END);
 }
Пример #2
0
 /**
  * Executes the widget.
  * @return string the result of widget execution to be outputted.
  */
 public function run()
 {
     $id = $this->id;
     $view = $this->getView();
     LinkPreviewAsset::register($view);
     $options = Json::encode($this->clientOptions);
     $view->registerJs("\$('#{$id}').linkPreview({$options});", $view::POS_END);
     parent::run();
 }