2012-09-28 4 views
0

정적 오브젝트 용 zend 프레임 워크에서 내 자신의 yaml 파일을 만들려고합니다. application.ini 파일을 바꾸고 싶지 않습니다.젠드 프레임 워크에서 yaml 사용하기

나는

응용 프로그램

reportInfo: 
    team_a: 
    some_var: some_var 
    some_var_1: some_var1 
    team_b: 
    some_var: some_var 
    some_var_1: some_var1 

가 어떻게 reportInfo의 값을받을 수 있나요/reports.yaml 내부 인덱스 컨트롤러 말 CONFIGS 내부에 다음 파일을 추가 한?

$reportInfo = Zend_Get_YAML ('configs/reports.yaml') // or something similar this is a guess 
print_r($reportInfo); 

답변

0

무엇을 시도 했습니까?

당신이 Zend_Config_Yaml 또는 sfYaml :: 덤프 또는 the new yaml component

와 함께 할 수있는 컨트롤러에이 시도 :

$config = Zend_Config_Yaml::decode(file_get_contents(
    APPLICATION_PATH . '/configs/reports.yaml', 
)); 
print_r($config); 
+0

자사가 yaml.php 파일을 찾을 수 없다는? –

관련 문제