开发者

unexpected T_ELSE in html/php template

If you can find it I will be happy, all though I am pretty sure the syntax is correct. Line 36 throws the error, which is the first else.

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;?>


Well there is one opening foreach but two closing endforeach.


I'd recommend that you edit your <? if([...] ?> into <?php if([...] ?>. I'm not too sure if that solves all of your problems, but the <? isn't valid in newer php-releases.


Do you have short open tags turned on? If not, your first if needs a full <?php

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜