2012-02-24 1 views
1

채널 맞춤 필드를 PHP 배열 var에 할당 할 수 있습니까? 이 같은표현식 채널 사용자 정의 필드를 PHP 배열로 변환 하시겠습니까?

뭔가 :

{exp:channel:entries channel="challenges" require_entry="yes" limit="1" cache="yes" refresh="60"} 

{reverse_related_entries id="week_stats"} 
<?php 
$i = 1; 
$stats[$i]['fat'] = "{body_fat}"; 
$stats[$i]['weight'] = "{weight}"; 
$stats[$i]['biceps'] = "{bicep_left}"; 
$stats[$i]['chest'] = "{chest}"; 
$stats[$i]['thigh'] = "{thigh_left}" 
$i++ 
?> 

{/reverse_related_entries} 
<?php print_r($stats);?> 
... 
... 
... 
{/exp:channel:entries} 

물론 PHP 템플릿 구문 분석 ON (출력)해야한다. 나는 이것을 시도했지만 배열과 함께 작동하지 않는다 ??

팁이 있습니까?

답변

0

갈 수있는 몇 가지 잘못된 위치 /가 있습니다.

1) 모든 태그 데이터가 PHP를 중단하는 견적을 '' '포함되어 있으면 출력을 구문 분석하고 이후

2) 세미콜론이 누락 된 경우

$stats[$i]['thigh'] = "{thigh_left}" 
관련 문제