배열에서 데이터를 인쇄하려고합니다. 배열은 클래스에서 온 것입니다. 내가 잘못클래스 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();
?>
을하고 있어요 무엇 :
Array ([0] => header_index.php [1] => footer.php)
코드는 다음과 같습니다 나는
array(0) { }
대신
받고 있어요? 감사합니다 사전에
'get_object_vars()'는 객체의 공개 __properties__를 반환합니다. 해당 메서드에 사용 된 로컬 변수가 아닙니다. –