亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在 Laravel 的 1 個函數中使用 2 個翻譯?

如何在 Laravel 的 1 個函數中使用 2 個翻譯?

PHP
嚕嚕噠 2023-08-19 14:08:32
我有一個功能,需要為俄語和英語版本進行 2 個翻譯。我已經簡單地做到了:'message' => trans('notify.bust_withdraw') . $get->amount .  X =   . $cashout .  trans('notify.bust_nostart')  . $profit . ,但我收到錯誤:Parse error: syntax error, unexpected ''. $get->amount . '' (T_CONSTANT_ENCAPSED_STRING), expecting ']'X = 這是靜態詞,沒有翻譯。為什么我收到錯誤?我的錯誤可能在哪里?編輯:我的完整代碼:Notify::create(['user_id' => $this->user->id,'title' => 'Crash Game','message' => trans('notify.bust_withdraw') . $get->amount .  'X ='   . $cashout .  trans('notify.bust_nostart')  . $profit ,'status' => '1',]);
查看完整描述

1 回答

?
ITMISS

TA貢獻1871條經驗 獲得超8個贊

嘗試這個:


$message = trans('notify.bust_withdraw') . $get->amount .  'X ='   . $cashout .  trans('notify.bust_nostart')  . $profit;

Notify::create(

[

'user_id' => $this->user->id,

'title' => 'Crash Game',

'message' => $message ,

'status' => '1'

]);

我為靜態字符串“X =”添加了字符串文字,并刪除了 . 最后因為沒有更多的串聯


查看完整回答
反對 回復 2023-08-19
  • 1 回答
  • 0 關注
  • 101 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號