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  * WhCountries.php
 5  *
 6  * Date: 06/09/14
 7  * Time: 14:17
 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.WhDropDownInputWidget');
13 
14 class WhTimezones extends WhDropDownInputWidget
15 {
16 
17     /**
18      * @var string the two letter country code or ID of a bfh-countries HTML element. To filter based on a country.
19      * It is required.
20      */
21     public $country;
22 
23     public function init()
24     {
25         if (empty($this->country) && !isset($this->pluginOptions['country'])) {
26             throw new CException('"$country" cannot be empty.');
27         }
28 
29         $this->pluginOptions['country'] = TbArray::getValue('country', $this->pluginOptions, $this->country);
30 
31         parent::init();
32 
33         TbHtml::addCssClass('bfh-timezones', $this->htmlOptions);
34 
35         unset($this->htmlOptions['data-name']);
36     }
37 
38     public function run()
39     {
40         if(!$this->readOnly) {
41             echo $this->dropDownList();
42         } else
43         {
44             echo CHtml::tag('span', $this->htmlOptions, '');
45         }
46 
47         $this->registerPlugin('bfhcountries');
48     }
49 }
YiiWheels API documentation generated by ApiGen 2.8.0