cakephp 2.0中的双下划线

时间:2012-02-16 21:48:39

标签: php cakephp

我认为双下划线总是意味着私有功能,但在像这样的例子中,cakephp 2.0意味着什么 http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html

例如

$this->Session->setFlash(__('The user could not be saved. Please, try again.'));

1 个答案:

答案 0 :(得分:14)

CakePHP中的双下划线功能处理本地化。当您想通过提供字符串翻译字典来翻译应用程序时使用它。

Cake PHP Book: Global Constants & Functions

另见Internationalization and Localization