Yii Framework Forum: Sintag Extension - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Sintag Extension extension for create tags on form Rate Topic: -----

#1 User is offline   Singrana 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 20-April 13

Posted 20 April 2013 - 02:03 PM

Simple widget to transform input field to input tags field

Usage:

In your form insert

<?php echo $form->textField($model, 'tags', array('id' => 'tags')); ?>
<?php
$this->widget('ext.sinTags.SinTagsWidget', array
(
	'attribute'		=>	'tags',
	'addTagLabel'	=>	'Add a tag',
	'autocomplete'	=>	'/tags/Tags/tagsCompetitions',
));
?>


Params:
attribute - your id input field attribute
addTagLabel - label on text field
autocomplete - if your need autocompetitions tag, insert path to your script to generate json autocompetitions list. If this not required - not use this param.

JSON data example:
[ { "id": "Netta rufina", "label": "Red-crested Pochard", "value": "Red-crested Pochard" }, { "id": "Sterna sandvicensis", "label": "Sandwich Tern", "value": "Sandwich Tern" }, { "id": "Saxicola rubetra", "label": "Whinchat", "value": "Whinchat" }, { "id": "Saxicola rubicola", "label": "European Stonechat", "value": "European Stonechat" }, { "id": "Lanius senator", "label": "Woodchat Shrike", "value": "Woodchat Shrike" }, { "id": "Coccothraustes coccothraustes", "label": "Hawfinch", "value": "Hawfinch" }, { "id": "Ficedula hypoleuca", "label": "Eurasian Pied Flycatcher", "value": "Eurasian Pied Flycatcher" }, { "id": "Sitta europaea", "label": "Eurasian Nuthatch", "value": "Eurasian Nuthatch" }, { "id": "Pyrrhula pyrrhula", "label": "Eurasian Bullfinch", "value": "Eurasian Bullfinch" }, { "id": "Muscicapa striata", "label": "Spotted Flycatcher", "value": "Spotted Flycatcher" }, { "id": "Carduelis chloris", "label": "European Greenfinch", "value": "European Greenfinch" }, { "id": "Carduelis carduelis", "label"
: "European Goldfinch", "value": "European Goldfinch" } ]

Attached File(s)


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users