testwidget.php

来自「Professional PHP5 code for this book」· PHP 代码 · 共 18 行

PHP
18
字号
<?phprequire_once('class.Widget.php');  try {    $objWidget = new Widget(1);      print "Widget Name: " . $objWidget->getName() . "<br>\n";    print "Widget Description: " . $objWidget->getDescription() . "<br>\n";    $objWidget->setName('Bar');    $objWidget->setDescription('This is a bartacular widget!');  } catch (Exception $e) {      die("There was a problem: " . $e->getMessage());  }?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?