laravel-5 - 复数标签的语法
问题描述
鉴于 5.7 laravel 应用程序,我想考虑复数的项目数量,比如
{{ count($activeVoteCategories) }} vote @if(count($activeVoteCategories) > 1)s @endif
但结果标签无效,因为在最后一个“s”符号之前有不必要的空格:
6 vote s
如果我试图摆脱这个空间
{{ count($activeVoteCategories) }} vote@if(count($activeVoteCategories) > 1)s @endif
我得到错误:
syntax error, unexpected 'endif' (T_ENDIF), expecting end of file (View: /mnt/_work_sdb8/wwwroot/lar/
我知道本地化功能有多种方法,但是这个网站没有本地化,它总是用英文......
哪个是正确的方法?
谢谢!
解决方案
推荐阅读
- html - 如果没有硬刷新,html 更改不会反映
- android - 设置默认语言环境 LTR (Android)
- android - 颤动中的可移动容器
- c++ - 为什么在这种情况下“if constexpr”的行为不符合预期?
- java - 如何在一个项目中同时使用 Cassandra 和 MYSQL?
- arrays - 嵌套 *ngFors - 更好的选择?(角度 7)
- php - bigcommerce 中必须将哪个 url 放入 AUTH 回调 url
- android - 如何从 Retrofit 读取字符串响应
- android - BaseExpandableListAdapter 在旧项目上重写新项目
- amazon-web-services - 是否可以将 Datadog Aurora 仪表板导出为云形成?