我有一个名为 DatabaseController 的类,我已将其设置为:
<?php
class DBController {
public $dbName;
function _controller($passedDBName) {
$dbName = $passedDBName;
}
function dbConnect() {
print $this->$dbName;
}
} //end of class
?>
我这样称呼它:
<?php
//make new database connection
$dbManager = new DBController("somevalue");
$dbManager->dbConnect();
?>
但我不断收到此错误:
<b>Fatal error</b>: Cannot access empty property in
我究竟做错了什么?
谢谢