我想使用一个内容表,我拥有所有的翻译值。在laravel 4,我们有以下脚本语言文件:laravel 4:从sql表中生成语言文件数组
return array(
"password" => "Passwords must be at least six characters and match the confirmation.",
"user" => "We can't find a user with that e-mail address.",
"token" => "This password reset token is invalid.",
"sent" => "Password reminder sent!",
);
我创建这个数组由一个foreach与下面的脚本:
$array = DB::table('Content_BO_Reminder')->get();
$returnarray = array();
foreach ($array as $value) {
$returnarray[] = '
\''.$value->key.'\' => \''.$value->value_en.'\',
';
}
return $returnarray;
但结果当我尝试拨打以下函数{{trans('reminder.password')}}是reminder.password。
任何人有一个想法?在此先感谢
请,加的print_r或$ returnarray的的var_dump。 –
vardump is:array(2){[0] => string(34)''password'=>'我们无法找到具有该电子邮件地址的用户。',“[1] => string(26 )“'next'=>'next',”} – Matthieu