的确忘记了 但改完后还是显示 Use of undefined constant ”Config - assumed '”Config' [APP\controllers\mytests_controller.php, line 17] Use of undefined constant language” - assumed 'language”' [APP\controllers\mytests_controller.php, line 17] Fatal error: Call to undefined function _() in C:\wk\Apache2.2\htdocs\ingame\app\views\mytests\third.ctp on line 4对应的17行是: $language = 'chi'; // 要翻译为何种语言 $this->Session->write (”Config.language”,$language);对应的4行是: echo _('strId');是不是我还有什么东西还没有导入? 谢谢回复
echo _('strId');
?>
但改完后还是显示
Use of undefined constant ”Config - assumed '”Config' [APP\controllers\mytests_controller.php, line 17]
Use of undefined constant language” - assumed 'language”' [APP\controllers\mytests_controller.php, line 17]
Fatal error: Call to undefined function _() in C:\wk\Apache2.2\htdocs\ingame\app\views\mytests\third.ctp on line 4对应的17行是:
$language = 'chi'; // 要翻译为何种语言
$this->Session->write (”Config.language”,$language);对应的4行是:
echo _('strId');是不是我还有什么东西还没有导入?
谢谢回复
谢谢你帮了我大忙
$this->Session->write('Config.language', 'fre');
但为什么这样用不行呢,
官方说Configure::write('Config.language', 'chi');
好像也可以的