php - 为什么 VSC IDE 不会忽略注释掉的代码?
问题描述
为什么 VSC IDE 不会忽略注释掉的代码?据我了解,对象的对象属性是这样访问的:
$parentobj->$daughterobj.
所以,这应该没问题。我有一个构建表格的索引页。
@foreach($events as $event)
<tr>
<td>{{ $event->id }}</td>
<td>{{ $event->eventTitle }}</td>
<td>{{ substr($event->eventDescription, 0, 24)}}</td>
{{-- the IDE trips on the next line, Undefined variable: memory. -->
<td>{{ $event->$memory->id}}</td>
<td>{{ $event->$memory->memTitle}}</td>
<td>{{ substr($event->$memory->memBody,0,24)}}</td>```
**{{-- if I comment them with {{-- --}} it still complains about the Undefined variable: memory**
```<td>{{ date('Y-m-d', strtotime($event->created_at)) }}</td>
<td>
<a href="show/{{$event->id}}" class="btn btn-primary">Show</a>
<a href="event/{{$event->id}}/edit" class="btn btn-primary">Edit</a>
<form action="/postmem/{{$event->id}}" method="post" class="d-inline">
{{ csrf_field() }}
@method('DELETE')
<button class="btn btn-danger" type="submit">Delete</button>
</form>
</td>
</tr>
@endforeach
有人可以告诉我为什么 IDE 正在读取注释掉的行吗?
解决方案
因为我使用了错误的评论字符。应该的<!--
-->
,不是{!--
--}
的。坏我。
推荐阅读
- php - Laravel 5.4 是否与 PHP 7.3 兼容
- python-3.x - 如何合并同一数据框中的两行
- sql - 根据条件更新 seq - Oracle SQL
- simulation - 服务项目的使用
- protocol-buffers - 为什么协议缓冲区不是使用标记对基于文本的文档进行建模的好方法?
- swift - NSAttributedString 和 emoji:我从未设置的范围似乎已设置
- swift - 如何在 swift 中将音乐作为 Document 目录播放?
- llvm - llvm 运行万花筒示例
- amazon-web-services - 为什么可以选择在安全组内为 ICMP Echo Reply 创建规则?
- android - 使用 Android DownloadManager 在 Android Oreo 8.1 中下载到外部 sd 卡不成功