最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為啥什么都沒顯示……也沒報(bào)錯(cuò)……說好的hello world呢!

<?php

	class?testController{
		function?show(){?//控制器的作用時(shí)調(diào)用模型,并調(diào)用視圖,將模型產(chǎn)生的數(shù)據(jù)傳遞給視圖,并讓相關(guān)視圖去顯示
			$testModel?=?new?testModel();
			$data?=?$testModel->get();
			$testView?=?new?testView();
			$testView->$display($data);
		}
	}


?>
<?php

	class?testModel{
		function?get(){?//模型的作用時(shí)獲取數(shù)據(jù)并處理返回?cái)?shù)據(jù)
			return?"Hello?World!";
		}
	}

?>

testView.class.php

<?php

	class?testView{
		function?display($data){?//視圖的作用時(shí)將取得的數(shù)據(jù)進(jìn)行組織,美化等,并最終向用戶終端輸出
			echo?$data;
		}
	}

?>
<?php

//如果有錯(cuò),include()報(bào)一個(gè)警告
//如果有錯(cuò),require_once()報(bào)一個(gè)嚴(yán)重錯(cuò)誤

require_once('testController.class.php');
require_once('testModel.class.php');
require_once('testView.class.php');

$testController?=?new?testController();
$testController->show();

?>


正在回答

1 回答

testController里的這個(gè)地方 $testView->$display($data); 寫錯(cuò)了,應(yīng)該是$testView->display($data);

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

全民工作狂 提問者

果然!謝謝老師!
2015-09-30 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為啥什么都沒顯示……也沒報(bào)錯(cuò)……說好的hello world呢!

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)