Prado\Web\UI\WebControls\TRadioButtonList::loadPostData PHP 메소드

loadPostData() 공개 메소드

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
리턴 boolean whether the data of the control has been changed
    public function loadPostData($key, $values)
    {
        $value = isset($values[$key]) ? $values[$key] : '';
        $oldSelection = $this->getSelectedIndex();
        $this->ensureDataBound();
        foreach ($this->getItems() as $index => $item) {
            if ($item->getEnabled() && $item->getValue() === $value) {
                if ($index === $oldSelection) {
                    return false;
                } else {
                    $this->setSelectedIndex($index);
                    return true;
                }
            }
        }
        return false;
    }