1. Go to this page and download the library: Download justinvoelker/yii2-tagging library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
justinvoelker / yii2-tagging example snippets
$query = new TaggingQuery;
$tags = $query
->select('tags')
->from('posts')
->getTags();
$query = new TaggingQuery;
$tags = $query
// used to refine an existing list
//->items($existingTaggingQueryResults)
// field that contains the desired tags
->select('tags')
// table to select from
->from('post')
// delimiter (default: `,` (comma))
->delimiter(',')
// number of tags to display (omit for all tags)
->limit(50)
// order used when a limit is being applied
->limitSort(['freq' => SORT_DESC, 'name' => SORT_ASC])
// order of the resulting list
->displaysort(['name' => SORT_ASC])
// array of tags to be excluded
->exclude(['junk'])
// array of tags to be
echo TaggingWidget::widget([
// TaggingQuery results
'items' => $tags,
// smallest tag size (default: 14)
'smallest' => '14',
// largest tag size (default: 22)
'largest' => '22',
// unit for tag sizes (default: px)
'unit' => 'px',
// display format of 'cloud', 'ul', or 'ol' (default: cloud)
'format' => 'cloud',
// url for links (omit for no link)
'url' => ['post/index'],
// parameter to be appended to url with tag
'urlParam' => 'tag',
// options applied to the list
'ulOptions' => ['style' => 'text-align:justify'],
// options applied to the list item
'liOptions' => [],
// options applied to the link (if present)
'linkOptions' => [],
]);
php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.