我有問題。Laravel 5 Lang :: get()替換
您可以使用Laravel 5中的Lang :: get(),我想做一個替換字符。
資源/郎/ EN/messages.php
<?php
return array(
'test' => 'test message. :name',
的意見/ top.blade.php
{!! App::setLocale('en') !!}
{!! Lang::get('messages.test', array('name' => 'Dayle')) !!}
然而,這是一個錯誤。
ErrorException in Translator.php line 148:
Missing argument 2 for Illuminate\Translation\Translator::Illuminate\Translation\{closure}(), called in /home/my-site/www/my-site/vendor/compiled.php on line 11547 and defined (View: /home/my-site/www/my-site/resources/views/top.blade.php)
原因我不知道。
你認識的人不?
同樣在這裏的問題作曲家更新 – dynamic
後,我通過刪除所有緩存文件,解決了這個問題。 (觀點,編譯等) – dynamic
也有同樣的問題,在我的情況下,問題是我寫了[':name'=>'Dayle']。我在'name'之前刪除了冒號,並且它工作正常。 – mwallisch