首页 > 解决方案 > Pug 中的 Laravel 助手

问题描述

我正在开发 Laravel CMS,但我使用 pug 作为模板而不是刀片,我的问题是如何使用,例如,{{ asset() }}或者{{ route() }}在我的 pugs 模板中使用?

标签: phplaravellaravel-blade

解决方案


您可以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}

推荐阅读