T_INLINE_HTML吗?这有什么错?

时间:2020-12-31 18:34:05
<? switch($data['type']) : ?>
<? case 'log': ?>

    <? while ($row = $data['loop']->fetch()) : ?>
        <table class="t-errors">
            <tr>
                <td>
                    <b>IP:</b> <? echo $row['LogShellIP']; ?>
                    <b>Command:</b> <? echo $row['LogShellCommand']; ?>
                    <b>Executed:</b> <? echo $row['LogShellReturn']; ?>
                    <b>Time:</b> <? echo format::time($row['LogShellTime']); ?>
                </td>
            </tr>
        </table>
    <? endwhile; ?>

<? break; ?>

<? case 'fatal': ?>
<? case 'warning': ?>
<? case 'notice': ?>
<? case 'unknown': ?>

    <? while ($row = $data['loop']->fetch()) : ?>
        <table class="t-errors">
            <tr>
                <td <? if ($row['LogErrorSeen'] == 0) { echo 'class="e-selected"'; } ?>>
                    <b>String:</b> <? echo $row['LogErrorString']; ?>
                    <b>File:</b> <? echo $row['LogErrorFile']; ?>
                    <b>Line:</b> <? echo $row['LogErrorLine']; ?>
                    <b>Context:</b> <? echo $row['LogErrorContext']; ?>
                    <b>Ip:</b> <? echo $row['LogErrorIP']; ?>
                    <b>Time:</b> <? echo format::time($row['LogErrorTime']); ?>
                </td>
            </tr>
        </table>
    <? endwhile; ?>

<? break; ?>
<? endswitch; ?>                    

I'm getting this error:

我得到这个错误:

Parse error: syntax error, unexpected T_INLINE_HTML, expecting T_ENDSWITCH or T_CASE or T_DEFAULT in /Applications/XAMPP/xamppfiles/htdocs/Smooth Framework/tpl/terminal.tpl.php on line 33

解析错误:语法错误,意外的T_INLINE_HTML,期望T_ENDSWITCH或T_CASE或T_DEFAULT in /Applications/XAMPP/xamppfiles/htdocs/ tpl/ end .tpl。php在33行

Where line 33 is the line 2 of this script. This is inserted in a template context. What's wrong with this? He is expecting a T_CASE and that's what is there!

第33行是这个脚本的第2行。这是插入到模板上下文中的。这有什么错?他在期待一个T_CASE,那就是它!

2 个解决方案

#1


10  

merge line 1 and 2

合并第1和第2行。

  <? switch($data['type']):
     case 'log': ?>

see the comment in this link (jeremia at gmx dot at 28-Jan-2008 02:52)

见此链接的评论(gmx点的jeremia在2008年1月28日02:52)

#2


3  

The parser expects a T_CASE token but finds the newline after switch($data['type']) : ?>.

解析器期望一个T_CASE令牌,但在转换后发现换行($data['type']): ?>。

switch (1) : ?> <? case 1: break; endswitch;

gives a parse error and so does

给出一个解析错误。

switch (1) : ?>\n<? case 1: break; endswitch;

while

switch (1) : ?><? case 1: break; endswitch; 

does not. ;-)

没有。:-)

#1


10  

merge line 1 and 2

合并第1和第2行。

  <? switch($data['type']):
     case 'log': ?>

see the comment in this link (jeremia at gmx dot at 28-Jan-2008 02:52)

见此链接的评论(gmx点的jeremia在2008年1月28日02:52)

#2


3  

The parser expects a T_CASE token but finds the newline after switch($data['type']) : ?>.

解析器期望一个T_CASE令牌,但在转换后发现换行($data['type']): ?>。

switch (1) : ?> <? case 1: break; endswitch;

gives a parse error and so does

给出一个解析错误。

switch (1) : ?>\n<? case 1: break; endswitch;

while

switch (1) : ?><? case 1: break; endswitch; 

does not. ;-)

没有。:-)