나는 함수에서 전달 된 클래스의 문자열 이름 만 가진 함수에서 이미 초기화 된 클래스를 사용하려고합니다.클래스의 이름 만 문자열로 가진 액세스 클래스
예 : 도움을
class art{
var $moduleInfo = "Hello World";
}
$art = new Art;
getModuleInfo("art");
function getModuleInfo($moduleName){
//I know I need something to happen right here. I don't want to reinitialize the class since it has already been done. I would just like to make it accessible within this function.
echo $moduleName->moduleInfo;
}
감사합니다!