新手解析错误T_DOUBLE_ARROW
我开始迈出进入 CakePHP 1.3 的第一步,但我遇到了一个无法找到的解析错误。我正在尝试 主要教程 并遇到此错误:
解析错误:语法错误,意外的 T_DOUBLE_ARROW,第 11 行 /Applications/XAMPP/xamppfiles/htdocs/mysite.com/app/views/posts/index.ctp 中期待 ')'
受影响的文件是:
<h1>Posts</h1>
<table>
<tr>
<th>ID</th>
<th>Title</th>
<th>Creation date</th>
</tr>
<?php foreach ($posts as $post): ?>
<tr>
<td><?php echo $post['Post']['id']; ?></td>
<td><?php echo $this->Html->link($post['Post']['title'], array ('controller', => 'posts', 'action' => 'view', $post['Post']['id'])); ?></td>
<td><?php echo $post['Post']['created']; ?></td>
</tr>
<?php endforeach; ?>
</table>
我哪里错了?
I'm starting to make my first steps into CakePHP 1.3, and I'm having a parse error I can't find. I'm trying the main tutorial and encountering this error:
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' in /Applications/XAMPP/xamppfiles/htdocs/mysite.com/app/views/posts/index.ctp on line 11
the file affected is:
<h1>Posts</h1>
<table>
<tr>
<th>ID</th>
<th>Title</th>
<th>Creation date</th>
</tr>
<?php foreach ($posts as $post): ?>
<tr>
<td><?php echo $post['Post']['id']; ?></td>
<td><?php echo $this->Html->link($post['Post']['title'], array ('controller', => 'posts', 'action' => 'view', $post['Post']['id'])); ?></td>
<td><?php echo $post['Post']['created']; ?></td>
</tr>
<?php endforeach; ?>
</table>
Where am I wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这一行中,
您需要删除控制器后的 , 。
我认为你需要在“查看”之后添加一个)
In this line
you need to remove the , after controller.
And I think you need to add an ) after ´view´