因此,我爲自己製作了一個內容管理系統,最近,一位朋友也想將它用於他的網站。我在頭腦中進行了適應性修改,但是,我希望通過所有錯誤字符串和消息字符串並將它們聚合到一個文件中。什麼是最好的方法來做到這一點?某種文本類?我只想要一個位置,我可以編輯所有消息。對於一些我正在使用DEFINE的東西,我知道這是不好的做法。在另一方面將文本字符串移動到一個單獨的文件
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/
'failed' => 'These credentials do not match our records.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
];
WordPress的沒有做它在所有的原始語言的字符串:
你可以使用get_defined_vars()和get_defined_constants(),但它只是通話的範圍內工程... – Webomatik