CakePhp自定义翻译功能

I want to create a custom cakePhp function for translations.

My translations are stored in a database table.

What I would like to do is to get the translations from the database and put them in a PHP array at bootstrap. I would also like to define a global function __t() that acts like __() but fetches the translation from my custom php array instead of po files.

I have defined my __t function in Config/bootsrap.php, but how can I access the database from Config/bootstrap.php to load the data into the array?

You need to use App::uses() to register classes you need and then instantiate the model:

App::uses('ClassRegistry', 'Utility');
$translationData = ClassRegistry::init('Modelname')->getTranslations();