HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/apklausos/application/extensions/yiiwheels/widgets/formhelpers/WhSelectBox.php
<?php
 /**
 * 
 * WhSelectBox.php
 *
 * Date: 06/09/14
 * Time: 13:57
 * @author Antonio Ramirez <amigo.cobos@gmail.com>
 * @link http://www.ramirezcobos.com/
 * @link http://www.2amigos.us/
 */
Yii::import('yiiwheels.widgets.formhelpers.WhInputWidget');

class WhSelectBox extends WhInputWidget
{
    /**
     * @var array the array keys are option values, and the array values
     * are the corresponding option labels.
     */
    public $data = array();

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();
        TbHtml::addCssClass('bfh-selectbox', $this->htmlOptions);
    }

    /**
     * @inheritdoc
     */
    public function run()
    {
        $input[] = CHtml::openTag('div', $this->htmlOptions);
        foreach ($this->data as $key => $value) {
            $input[] = CHtml::tag('div', array('data-value' => (string)$key), (string)$value);
        }
        $input[] = CHtml::closeTag('div');

        echo implode("\n", $input);

        $this->registerPlugin('bfhselectbox');
    }
}