未定义的属性:视图::$Js



正在获取此信息。网站在本地运行良好,但在生产服务器上我收到了这个错误。

cakepp verion 1.3

生产:php 5.3.3-7+挤压7偏差:5.3.3-7+挤压3

Notice (8): Undefined property: View::$Js [APP/views/layouts/default.ctp, line 31]
Code | Context
include - APP/views/layouts/default.ctp, line 31
View::_render() - CORE/cake/libs/view/view.php, line 736
View::renderLayout() - CORE/cake/libs/view/view.php, line 494
View::render() - CORE/cake/libs/view/view.php, line 440
Controller::render() - CORE/cake/libs/controller/controller.php, line 909
ErrorHandler::_outputMessage() - CORE/cake/libs/error.php, line 458
ErrorHandler::missingComponentFile() - CORE/cake/libs/error.php, line 415
Object::dispatchMethod() - CORE/cake/libs/object.php, line 112
ErrorHandler::__construct() - CORE/cake/libs/error.php, line 125
Object::cakeError() - CORE/cake/libs/object.php, line 201
Component::_loadComponents() - CORE/cake/libs/controller/component.php, line 216
Component::init() - CORE/cake/libs/controller/component.php, line 78
Controller::constructClasses() - CORE/cake/libs/controller/controller.php, line 483
CakeErrorController::__construct() - CORE/cake/libs/error.php, line 52
ErrorHandler::__construct() - CORE/cake/libs/error.php, line 90
Object::cakeError() - CORE/cake/libs/object.php, line 201
Component::_loadComponents() - CORE/cake/libs/controller/component.php, line 216
Component::init() - CORE/cake/libs/controller/component.php, line 78
Fatal error: Call to a member function writeBuffer() on a non-object in /var/www/website.local/views/layouts/default.ctp on line 31 

第31行为

echo $this->Js->writeBuffer(array('cache'=> true));

我在app_controller.php中有

<?php
class AppController extends Controller {
        var $helpers = array('Html','Form','Session','Js','Javascript');
        var $components = array(
                        'Session',
                        'RequestHandler',
                        'DebugKit.Toolbar'
                );
}
?>

看起来缺少一个组件文件:

ErrorHandler::missingComponentFile() - CORE/cake/libs/error.php, line 415

你可能想先研究一下这个错误,然后看看它是否能解决你的其他问题。

最新更新