A tag form, use it with taggable behvior
Yii 1.0 or above
Installation
replace all into
$tag_it_js=Yii::app()->getAssetManager()->publish($tag_it.'/tag-it.js'); $tag_it_css=Yii::app()->getAssetManager()->publish($tag_it.'/tag-it.css'); Yii::app()->clientScript //->registerCoreScript('jquery') FIX ->registerCoreScript('jquery.ui') ->registerScriptFile($tag_it_js) ->registerCssFile($tag_it_css) ->registerScript($id,' $("#'.$id.'").tagit({ tags: '.$tags.', url: "'.$url.'" }); ', CClientScript::POS_READY);
$tag_it - it`s my variable from widget
public function run() { $this->tags = json_encode($this->tags); // this method is called by CController::endWidget() $this->render('TagView', array( 'id' => $this->id, 'tags' => $this->tags, 'url' => $this->url, 'tag_it' => dirname(__FILE__), 'title' => $this->title, )); }
In the file TagView.php, delete the line
$jui=Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('zii.vendors.jui').'/js/jquery-ui.min.js');
And replace
$cs->registerScriptFile($jui);
with
$cs->registerCoreScript('jquery.ui');
Please login to leave your comment.
Total 2 comments
replace all into
$tag_it - it`s my variable from widget
In the file TagView.php, delete the line
And replace
with
Leave a comment
Please login to leave your comment.