Неопределенное свойство: View :: $ Js - PullRequest
0 голосов
/ 03 февраля 2012

Получение этого. Сайт работает нормально локально, но на рабочем сервере я получаю эту ошибку.

Cakephp Verion 1,3

Производство: php 5.3.3-7 + squeeze7 Dev: 5.3.3-7 + squeeze3

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'
                );
}

?>

1 Ответ

0 голосов
/ 03 февраля 2012

Похоже, вам не хватает файла компонента:

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

Вы можете сначала изучить эту ошибку, а затем посмотреть, исправит ли она вашу другую проблему.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...