代码 156
<?php
// 添加应用模块实践
class MessageAction extends Action{
//ThinkPHP特殊的操作方法 – 初始化
public function _initialize() {
echo '每个操作都会先执行此方法逻辑内容<br /><br />';
}
// URL访问实践2
public function test2 () {
header("Content-Type:text/html; charset=utf-8");
echo '成功地访问了test2操作!';
}
// URL访问实践 --- 获取GET变量 www.shkpw.com
public function test3 () {
header("Content-Type:text/html; charset=utf-8");
if (isset($_GET['abc'])) {
$text = $_GET['abc'];
}else {
$text = '没有接收到GET变量';
}
echo $text;
}
}//类定义 end
?>