函数名:setText()
适用版本:PHP 7.0.0 及以上版本
用法:setText() 函数用于设置 UI 控件中的按钮文本。
示例:
<?php
// 创建一个按钮对象
$button = new \UI\Controls\Button();
// 设置按钮的文本
$button->setText("Click me");
// 获取按钮的文本
$text = $button->getText();
echo $text; // 输出:Click me
?>
注意: