2011-08-10 5 views
1

찾을 수 있다면 나는 기꺼이 하겠지만 모든 구문이 정확하다고 확신한다. Line 36은 첫 번째 오류 인 오류를 throw합니다.예기치 않은 T_ELSE가 html/php 템플릿

if ($this->data): ?> 
<projections> 
    <?php foreach ($this->data as $aItem): ?> 
     <projection Id ="<?php echo $this->escape($aItem['id_hits'])?>"> 
     <? if ($aItem['position'] == "Gardien"): ?>   
     <matches_played><?php echo $this->escape($aItem['matches_played'])?></matches_played> 
     <goaltender_wins><?php echo $this->escape($aItem['goaltender_wins'])?></goaltender_wins> 
     <goaltender_losses><?php echo $this->escape($aItem['goaltender_losses'])?></goaltender_losses> 
     <goaltender_losses_overtime><?php echo $this->escape($aItem['goaltender_losses_overtime'])?></goaltender_losses_overtime> 
     <minutes_played><?php echo $this->escape($aItem['minutes_played'])?></minutes_played> 
     <goals_against_average><?php echo $this->escape($aItem['goals_against_average'])?></goals_against_average> 
     <shutouts><?php echo $this->escape($aItem['shutouts'])?></shutouts> 
     <goals_allowed><?php echo $this->escape($aItem['goals_allowed'])?></goals_allowed> 
     <shots_allowed><?php echo $this->escape($aItem['shots_allowed'])?></shots_allowed> 
     <save_percentage><?php echo $this->escape($aItem['save_percentage'])?></save_percentage> 
     <rank><?php echo $this->escape($aItem['rank'])?></rank> 
     <comment><?php echo $this->escape($aItem['comment'])?></comment> 
     <first_name><?php echo $this->escape($aItem['first_name'])?></first_name> 
     <last_name><?php echo $this->escape($aItem['last_name'])?></last_name> 
     <id_team><?php echo $this->escape($aItem['id_team'])?></id_team> 
     <team_name><?php echo $this->escape($aItem['team_name'])?></team_name> 
     <position><?php echo $this->escape($aItem['position'])?></position> 
     </projection> 
     <?php else: ?> 
     <matches_played><?php echo $this->escape($aItem['matches_played'])?></matches_played> 
     <goals><?php echo $this->escape($aItem['goals'])?></goals> 
     <assists><?php echo $this->escape($aItem['assists'])?></assists> 
     <points><?php echo $this->escape($aItem['points'])?></points> 
     <points_per_match><?php echo $this->escape($aItem['points_per_match'])?></points_per_match> 
     <plus_minus><?php echo $this->escape($aItem['plus_minus'])?></plus_minus> 
     <assists_power_play><?php echo $this->escape($aItem['assists_power_play'])?></assists_power_play> 
     <goals_power_play><?php echo $this->escape($aItem['goals_power_play'])?></goals_power_play> 
     <assists_short_handed><?php echo $this->escape($aItem['assists_short_handed'])?></assists_short_handed> 
     <goals_short_handed><?php echo $this->escape($aItem['goals_short_handed'])?></goals_short_handed> 
     <rank><?php echo $this->escape($aItem['rank'])?></rank> 
     <comment><?php echo $this->escape($aItem['comment'])?></comment> 
     <first_name><?php echo $this->escape($aItem['first_name'])?></first_name> 
     <last_name><?php echo $this->escape($aItem['last_name'])?></last_name> 
     <id_team><?php echo $this->escape($aItem['id_team'])?></id_team> 
     <team_name><?php echo $this->escape($aItem['team_name'])?></team_name> 
     <position><?php echo $this->escape($aItem['position'])?></position> 
     </projection> 
     <?php endif;?> 
    <?php endforeach; ?> 
    <?php endforeach; ?> 
</projections> 
<?php else: ?> 
<projections></projections> 
<?php endif;?> 
+1

두 endforeach이 원인; – mattacular

답변

2

음 한 개구 foreach 그러나 두 endforeach 개폐있다.

1

<? if([...] ?><?php if([...] ?>으로 수정하는 것이 좋습니다. 나는 당신의 모든 문제를 해결할 지 확신하지 못하지만, <?은 최신 php-release에서 유효하지 않습니다.

0

오픈 태그가 짧게 설정되어 있습니까? 그렇지 않은 경우, 첫 번째 if가 필요로 전체 <?php

<? if ($aItem['position'] == "Gardien"): ?>