本文整理匯總了PHP中TButton::setText方法的典型用法代碼示例。如果您正苦於以下問題:PHP TButton::setText方法的具體用法?PHP TButton::setText怎麽用?PHP TButton::setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TButton
的用法示例。
在下文中一共展示了TButton::setText方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createPagerButton
/**
* 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 mixed the container pager instance of TActiveDatagridPager
* @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($pager, $buttonType, $enabled, $text, $commandName, $commandParameter)
{
if ($buttonType === TDataGridPagerButtonType::LinkButton) {
if ($enabled) {
$button = new TLinkButton();
} else {
$button = new TLabel();
$button->setText($text);
return $button;
}
} else {
$button = new TButton();
if (!$enabled) {
$button->setEnabled(false);
}
}
$button->setText($text);
$button->setCommandName($commandName);
$button->setCommandParameter($commandParameter);
$button->setCausesValidation(false);
return $button;
}
示例2: createPagerButton
/**
* 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);
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);
return $button;
}
示例3: setText
/**
* Updates the button text on the client-side if the
* {@link setEnableUpdate EnableUpdate} property is set to true.
* @param string caption of the button
*/
public function setText($value)
{
parent::setText($value);
if ($this->getActiveControl()->canUpdateClientSide()) {
$this->getPage()->getCallbackClient()->setAttribute($this, 'value', $value);
}
}