Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CJuiAccordion
  • CJuiAutoComplete
  • CJuiButton
  • CJuiDatePicker
  • CJuiDialog
  • CJuiDraggable
  • CJuiDroppable
  • CJuiInputWidget
  • CJuiProgressBar
  • CJuiResizable
  • CJuiSelectable
  • CJuiSlider
  • CJuiSliderInput
  • CJuiSortable
  • CJuiTabs
  • CJuiWidget
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * CJuiSlider class file.
 4:  *
 5:  * @author Qiang Xue <qiang.xue@gmail.com>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: Yii::import('zii.widgets.jui.CJuiWidget');
12: 
13: /**
14:  * CJuiSlider displays a slider.
15:  *
16:  * CJuiSlider encapsulates the {@link http://jqueryui.com/slider/ JUI
17:  * slider} plugin.
18:  *
19:  * To use this widget, you may insert the following code in a view:
20:  * <pre>
21:  * $this->widget('zii.widgets.jui.CJuiSlider',array(
22:  *     'value'=>37,
23:  *     // additional javascript options for the slider plugin
24:  *     'options'=>array(
25:  *         'min'=>10,
26:  *         'max'=>50,
27:  *     ),
28:  *     'htmlOptions'=>array(
29:  *         'style'=>'height:20px;',
30:  *     ),
31:  * ));
32:  * </pre>
33:  *
34:  * By configuring the {@link options} property, you may specify the options
35:  * that need to be passed to the JUI slider plugin. Please refer to
36:  * the {@link http://api.jqueryui.com/slider/ JUI Slider API} documentation
37:  * for possible options (name-value pairs) and
38:  * {@link http://jqueryui.com/slider/ JUI Slider page} for general
39:  * description and demo.
40:  *
41:  * @author Qiang Xue <qiang.xue@gmail.com>
42:  * @package zii.widgets.jui
43:  * @since 1.1
44:  */
45: class CJuiSlider extends CJuiWidget
46: {
47:     /**
48:      * @var string the name of the container element that contains the slider. Defaults to 'div'.
49:      */
50:     public $tagName='div';
51:     /**
52:      * @var integer determines the value of the slider, if there's only one handle. If there is more than one handle, determines the value of the first handle.
53:      */
54:     public $value;
55: 
56:     /**
57:      * Run this widget.
58:      * This method registers necessary javascript and renders the needed HTML code.
59:      */
60:     public function run()
61:     {
62:         $id=$this->getId();
63:         if(isset($this->htmlOptions['id']))
64:             $id=$this->htmlOptions['id'];
65:         else
66:             $this->htmlOptions['id']=$id;
67: 
68:         echo CHtml::tag($this->tagName,$this->htmlOptions,'');
69: 
70:         if($this->value!==null)
71:             $this->options['value']=$this->value;
72: 
73:         $options=CJavaScript::encode($this->options);
74:         Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"jQuery('#{$id}').slider($options);");
75:     }
76: }
API documentation generated by ApiGen 2.8.0