YiiWheels
  • Package
  • Class
  • Tree

Packages

  • None
  • yiiwheels
    • behaviors
    • widgets
    • widgets
      • ace
      • box
      • datepicker
      • daterangepicker
      • datetimepicker
      • detail
      • fileupload
      • fileuploader
      • gallery
      • google
      • grid
        • behaviors
        • operations
      • highcharts
      • maskInput
      • maskmoney
      • modal
      • multiselect
      • rangeslider
      • redactor
      • select2
      • sparklines
      • switch
      • timeago
      • timepicker
      • toggle
      • typeahead

Classes

  • WhCountries
  • WhDatePickerHelper
  • WhDropDownInputWidget
  • WhFonts
  • WhFontSizes
  • WhGoogleFonts
  • WhInputWidget
  • WhLanguages
  • WhPhone
  • WhSelectBox
  • WhStates
  • WhTimePickerHelper
  • WhTimezones
 1 <?php
 2  /**
 3  * 
 4  * WhSelectBox.php
 5  *
 6  * Date: 06/09/14
 7  * Time: 13:57
 8  * @author Antonio Ramirez <amigo.cobos@gmail.com>
 9  * @link http://www.ramirezcobos.com/
10  * @link http://www.2amigos.us/
11  */
12 Yii::import('yiiwheels.widgets.formhelpers.WhInputWidget');
13 
14 class WhSelectBox extends WhInputWidget
15 {
16     /**
17      * @var array the array keys are option values, and the array values
18      * are the corresponding option labels.
19      */
20     public $data = array();
21 
22     /**
23      * @inheritdoc
24      */
25     public function init()
26     {
27         parent::init();
28         TbHtml::addCssClass('bfh-selectbox', $this->htmlOptions);
29     }
30 
31     /**
32      * @inheritdoc
33      */
34     public function run()
35     {
36         $input[] = CHtml::openTag('div', $this->htmlOptions);
37         foreach ($this->data as $key => $value) {
38             $input[] = CHtml::tag('div', ['data-value' => (string)$key], (string)$value);
39         }
40         $input[] = CHtml::closeTag('div');
41 
42         echo implode("\n", $input);
43 
44         $this->registerPlugin('bfhselectbox');
45     }
46 } 
YiiWheels API documentation generated by ApiGen 2.8.0