Blame view

vendor/kartik-v/yii2-krajee-base/Widget.php 2.01 KB
583ea05f   andryeyev   + widget-select2
1
2
3
4
5
6
  <?php
  
  /**
   * @package   yii2-krajee-base
   * @author    Kartik Visweswaran <kartikv2@gmail.com>
   * @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2015
280e92c2   Dmitryi   авторизация через...
7
   * @version   1.7.8
583ea05f   andryeyev   + widget-select2
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
   */
  
  namespace kartik\base;
  
  use Yii;
  
  /**
   * Base widget class for Krajee extensions
   *
   * @author Kartik Visweswaran <kartikv2@gmail.com>
   * @since  1.0
   */
  class Widget extends \yii\base\Widget
  {
      use TranslationTrait;
      use WidgetTrait;
  
      /**
       * @var array HTML attributes or other settings for widgets
       */
      public $options = [];
  
      /**
       * @var array widget plugin options
       */
      public $pluginOptions = [];
  
      /**
280e92c2   Dmitryi   авторизация через...
36
       * @var array widget JQuery events. You must define events in event-name => event-function format for example:
583ea05f   andryeyev   + widget-select2
37
38
39
40
41
42
43
44
45
46
       * ~~~
       * pluginEvents = [
       *     "change" => "function() { log("change"); }",
       *     "open" => "function() { log("open"); }",
       * ];
       * ~~~
       */
      public $pluginEvents = [];
  
      /**
280e92c2   Dmitryi   авторизация через...
47
48
49
50
51
52
       * @var string a pjax container identifier if applicable inside which the widget will be rendered. If this is set,
       *     the widget will automatically reinitialize on pjax completion.
       */
      public $pjaxContainerId;
  
      /**
583ea05f   andryeyev   + widget-select2
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
       * @var array the the internalization configuration for this widget
       */
      public $i18n = [];
  
      /**
       * @var string translation message file category name for i18n
       */
      protected $_msgCat = '';
  
      /**
       * @var string the name of the jQuery plugin
       */
      protected $_pluginName;
  
      /**
       * @var string the hashed global variable name storing the pluginOptions
       */
      protected $_hashVar;
  
      /**
       * @var string the element's HTML5 data variable name storing the pluginOptions
       */
      protected $_dataVar;
  
      /**
       * @var string the Json encoded options
       */
      protected $_encOptions = '';
  
      /**
       * @inheritdoc
       */
      public function init()
      {
          parent::init();
          if (empty($this->options['id'])) {
              $this->options['id'] = $this->getId();
          }
      }
  }