我试图从数组中打印数据。该数组来自一个类。我越来越从类php打印数组
array(0) { }
代替:
Array ([0] => header_index.php [1] => footer.php)
的代码是:
<?php
class TemplateModel {
public function getTemplate($template = "index"){
switch($template){
case "index":
$templateconfig = array("header_index.php","footer.php");
break;
}
return $templateconfig;
}
}
$temodel = new TemplateModel();
var_dump(get_object_vars($temodel));
$temodel -> getTemplate();
?>
什么,我做错了什么?在此先感谢
'get_object_vars()'返回一个对象的public __properties__;不是在其方法中使用的本地变量 –