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/ButtonGroupWidget/ButtonGroupWidget.php
<?php

/**
 * Creates a Buttongroup that behaves like a switch with radio input type
 */
class ButtonGroupWidget extends CInputWidget
{
    /**
     * @var array Available buttons as value=>caption array
     */
    public $selectOptions = [];

    /** @var string aria label for btn-group */
    public $ariaLabel = '';

    /** @var array html options */
    public $htmlOptions = [];

    /** @var array the value that is currently checked/selected */
    public $checkedOption = '';

    /** Initializes the widget */
    public function init()
    {
        $this->registerClientScript();
    }

    /** Executes the widget */
    public function run()
    {
        $this->renderButtons();
    }

    /** Renders the button group */
    public function renderButtons()
    {
        list($name, $id) = $this->resolveNameID();
        $this->render('buttongroup', [
            'ariaLabel' => $this->ariaLabel,
            'name' => $name,
            'id' => $id,
            'selectOptions' => $this->selectOptions,
            'checkedOption' => $this->checkedOption,
            'htmlOptions' => $this->htmlOptions
        ]);
    }


    /** Registers required script files */
    public function registerClientScript()
    {
    }
}