Prado\Web\UI\WebControls\TButton::setText PHP Method

setText() public method

public setText ( $value )
    public function setText($value)
    {
        $this->setViewState('Text', $value, '');
    }

Usage Example

Beispiel #1
0
 /**
  * Creates a pager button.
  * Depending on the button type, a TLinkButton or a TButton may be created.
  * If it is enabled (clickable), its command name and parameter will also be set.
  * Derived classes may override this method to create additional types of buttons, such as TImageButton.
  * @param string button type, either LinkButton or PushButton
  * @param boolean whether the button should be enabled
  * @param string caption of the button.
  * @param string CommandName corresponding to the OnCommand event of the button.
  * @param string CommandParameter corresponding to the OnCommand event of the button
  * @return mixed the button instance
  */
 protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter)
 {
     if ($buttonType === TPagerButtonType::LinkButton) {
         if ($enabled) {
             $button = new TLinkButton();
         } else {
             $button = new TLabel();
             $button->setText($text);
             $button->setCssClass($this->getButtonCssClass());
             return $button;
         }
     } else {
         if ($buttonType === TPagerButtonType::ImageButton) {
             $button = new TImageButton();
             $button->setImageUrl($this->getPageImageUrl($text, $commandName));
         } else {
             $button = new TButton();
         }
         if (!$enabled) {
             $button->setEnabled(false);
         }
     }
     $button->setText($text);
     $button->setCommandName($commandName);
     $button->setCommandParameter($commandParameter);
     $button->setCausesValidation(false);
     $button->setCssClass($this->getButtonCssClass());
     return $button;
 }
All Usage Examples Of Prado\Web\UI\WebControls\TButton::setText