php - Pug 中的 Laravel 助手
问题描述
我正在开发 Laravel CMS,但我使用 pug 作为模板而不是刀片,我的问题是如何使用,例如,{{ asset() }}
或者{{ route() }}
在我的 pugs 模板中使用?
解决方案
您可以route()
这样使用:
each country in countries
div(
class="
col-md-6
col-lg-4
my-padding-bottom-19
my-filter-object
my-country
"
data-controller="country"
data-country-url-delete = route('countries.destroy', country)
)
.my-frame
.my-padding-bottom-12.my-filter-target
##{ country.id }: #{country.label}
推荐阅读
- python - 导入 python 包在运行 .py 脚本时不起作用,但在 Jupyter 中运行时起作用
- python - 试图将数据框行分配给单词列表(Python)
- flask - sqlite Flask如何过滤
- javascript - 合并 2 个保持内部元素数组值的数组
- reactjs - React - 检测顶级应用程序组件的先前位置?
- android - 回收站视图跳过布局
- python - 具有不同字体大小的对等文本小部件中的粗体标记
- r - R中函数内变量的范围
- machine-learning - 如果数据集不平衡,你如何测试机器学习算法?
- javascript - 运行 webpack 后未定义 Javascript 函数