Prado\Web\UI\WebControls\TEditCommandColumn::createButton PHP Method

createButton() protected method

The button type is determined by {@link getButtonType ButtonType}.
protected createButton ( $commandName, $text, $causesValidation, $validationGroup ) : mixed
return mixed the newly created button.
    protected function createButton($commandName, $text, $causesValidation, $validationGroup)
    {
        if ($this->getButtonType() === TButtonColumnType::LinkButton) {
            $button = new TLinkButton();
        } else {
            if ($this->getButtonType() === TButtonColumnType::PushButton) {
                $button = new TButton();
            } else {
                $button = new TImageButton();
                if (strcasecmp($commandName, 'Update') === 0) {
                    $url = $this->getUpdateImageUrl();
                } else {
                    if (strcasecmp($commandName, 'Cancel') === 0) {
                        $url = $this->getCancelImageUrl();
                    } else {
                        $url = $this->getEditImageUrl();
                    }
                }
                $button->setImageUrl($url);
            }
        }
        $button->setText($text);
        $button->setCommandName($commandName);
        $button->setCausesValidation($causesValidation);
        $button->setValidationGroup($validationGroup);
        return $button;
    }