LoginSignup
1
0

More than 1 year has passed since last update.

laravel __()関数

Posted at

概要

  • laravelの__()関数についてまとめてみる。

__()関数

  • 下記のように使われる。

    __('Foo')
    
  • 本関数の意味は「当該の文字列に紐づく翻訳キーが設定されている場合、翻訳した文字を返す。設定されていない場合当該の文字列をそのまま帰す」である。

  • また、下記の様に記載されていたら、lang/en/pagenation.php(config/app.phpでlocaleがjaの場合はlang/en/pagenation.php)のキーpreviousに紐づく値が設定されている場合その値を、設定されていない場合pagenation.previousを返す。

    __('pagenation.previous')
    

参考文献

1
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0