【问题标题】:Laravel: translate string in @sectionLaravel:翻译@section中的字符串
【发布时间】:2020-02-24 13:31:50
【问题描述】:

我的刀片模板如下所示:

@extends('layouts.main')

@section('title', 'Houses')

@section('content')
<div class="row">
... etc

如果我想这样翻译标题:

@section('title', {{ __('Houses') }})

我收到此错误:

Facade\Ignition\Exceptions\ViewException 语法错误,意外'

我应该如何正确翻译@section 中的字符串?

【问题讨论】:

    标签: laravel laravel-6


    【解决方案1】:

    试试这个:

    @section('title', __('Houses'))
    

    【讨论】:

      猜你喜欢
      • 2015-09-04
      • 2018-01-09
      • 1970-01-01
      • 2010-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-20
      • 1970-01-01
      相关资源
      最近更新 更多