2017 © Pedro Peláez
 

yii2-extension yii2-jqcloud2-widget

Yii 2 jQCloud-widget

image

coderius/yii2-jqcloud2-widget

Yii 2 jQCloud-widget

  • Sunday, July 1, 2018
  • by coderius
  • Repository
  • 0 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

jQCloud widget for Yii2

The jQCloud widget is a customized jQCloud script based on jQCloud. and This widget used to word clouds and tag clouds that are actually shaped like a cloud., (*1)

jQCloud screenshot:

alt text, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require coderius/yii2-jqcloud2-widget "@dev"

or add, (*5)

"coderius/yii2-jqcloud2-widget" : "@dev"

to the require section of your application's composer.json file., (*6)

Basic usage.

In view:, (*7)

use coderius\jqcloud2;

= \coderius\jqcloud2\jQCloud::widget([
    'tagOptions' => [
        'style' => 'width:100%; height: 350px; border: 1px solid #ccc;',
    ],
    
    'wordsOptions' => [
        ['text'=>"Lorem",'weight' => 13, 'link' =>"#"],
        ['text'=>"Ipsum",'weight' => 10.5, 'html' => ['title' => "My Title", "class" => "custom-class"], 'link' => ['href' => "http://jquery.com/", 'target' => "_blank"]],
        [
            'text'=>"Dolor",
            'weight' => 9.4, 
            'handlers' => [
                'click' => new \yii\web\JsExpression("
                    function() {
                        alert('You clicked the word !');
                    }
                "),
            ]
        ],
        ['text'=>"Sit",'weight' => 8],
        ['text'=>"Amet",'weight' => 6.2],
        ['text'=>"Consectetur",'weight' => 5],
        ['text'=>"Adipiscing",'weight' => 5],
        ['text'=>"Elit",'weight' => 5],
        ['text'=>"Nam et", 'weight' => 5]
            
    ],
   
]); ?>

Advanced usage.

In view:, (*8)

use coderius\jqcloud2;

= \coderius\jqcloud2\jQCloud::widget([
    'tagOptions' => [
        'style' => 'width:100%; height: 350px; border: 1px solid #ccc;',
//        'id' => 'myid',
        ],
    
    'wordsOptions' => [
        ['text'=>"Lorem",'weight' => 13, 'link' =>"#"],
        ['text'=>"Ipsum",'weight' => 10.5, 'html' => ['title' => "My Title", "class" => "custom-class"], 'link' => ['href' => "http://jquery.com/", 'target' => "_blank"]],
        [
            'text'=>"Dolor",
            'weight' => 9.4, 
            'handlers' => [
                'click' => new \yii\web\JsExpression("
                    function() {
                        alert('You clicked the word !');
                    }
                "),
            ]
        ],
        ['text'=>"Sit",'weight' => 8],
        ['text'=>"Amet",'weight' => 6.2],
        ['text'=>"Consectetur",'weight' => 5],
        ['text'=>"Adipiscing",'weight' => 5],
        ['text'=>"Elit",'weight' => 5],
        ['text'=>"Nam et", 'weight' => 5]
            
    ],
    'cloudOptions' => [
        'delay' => 50,
        'autoResize' => true,
//        'colors' => ["#800026", "#bd0026", "#e31a1c", "#fc4e2a", "#fd8d3c", "#feb24c", "#fed976", "#ffeda0", "#ffffcc"],
        'fontSize' => [
            'from' => 0.1,
            'to' => 0.02
        ]
    ],
    'methods' =>    function($containerId, $words){
                        return new \yii\web\JsExpression("
                            var arr = arr || $words;
                            $('#update-demo').on('click', function(e) {
                                e.preventDefault();
                                arr.splice(0, 1);
                                $('#{$containerId}').jQCloud('update', arr);
                            });
                            
//                            $('#{$containerId}').jQCloud('destroy');

                        ");
                    } 
   
    
]); ?>

Help us to improve this extention.

Please click on the link below to set star if You decide that this extention is useful for you., (*9)

More info about options look in: site about jQuery plugin, (*10)

Reference to plugin github repository that is used in this widget., (*11)

The Versions

01/07 2018

dev-master

9999999-dev

Yii 2 jQCloud-widget

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 widget jqcloud yii2-jqcloud2-widget

01/07 2018

v1.0.1

1.0.1.0

Yii 2 jQCloud-widget

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 widget jqcloud yii2-jqcloud2-widget

23/06 2018

v1.0.0

1.0.0.0

Yii 2 lightbox2-widget

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 widget lightbox lightbox2