【发布时间】:2014-09-11 17:24:21
【问题描述】:
当我使用 __() 函数在 AppController 中翻译消息时,我收到以下错误:
PHP 解析错误:语法错误,意外 '(',期待 ')'
这是我的代码:
public $components = array(
'Session',
'Acl',
'Auth' => array(
'authError' => __('Did you really think you are allowed to see that?'),
'authorize' => array(
'Actions' => array('actionPath' => 'controllers')
)
)
);
__() 应该是一个全局函数,对吧?因为似乎 PHP 没有调用它。
【问题讨论】: