2012-12-27 1 views
0

내 프로젝트에 cakephp 디버그 플러그인을 구현합니다. 내 appcontroller.php 파일에서 은 내가CakePhp cakesession이 cake php 디버그 키트와 함께 작동하지 않습니다.

var $helpers = array('Html', 'Form', 'Paginator', 'Js', 'Session'); 
public $components = array('DebugKit.Toolbar'); 

and in before filter i implement 
function beforeFilter() { 
    if ($this->Session->check('GlobalFields')==false) { 
    $this->Session->write('GlobalFields.tbl_assets.template_information_global', ''); 
    $this->Session->write('GlobalFields.tbl_assets.hilitelibrary', ''); 
    $this->Session->write('GlobalFields.tbl_assets.hilitesortedby', ''); 
    $this->Session->write('GlobalFields.tbl_assets.sc_url_prefix', ''); 
    } 
} 
    but it showing error 
    Fatal error: Call to a member function check() on a non-object. 
    and i check that debug($this->Session) returns null. 

if i remove public $components = array('DebugKit.Toolbar'); then its run correctly. 
but i want to implement that debugkit with session. 

날이 문제를 해결하는 데 도움이 바랍니다 추가 할 수 있습니다. 당신이 SessionComponent 포함하는 기본값을 재정의

public $components = array('DebugKit.Toolbar'); 

: 여기 무슨 일

답변

2

음으로 설정하는 것입니다. 변수 $helpersSessionHelper을 첨부하고 있지만이 두 클래스는 다릅니다. 첫 번째 구성 요소는 컨트롤러 내에서 세션 데이터와 상호 작용할 수 있고 두 번째 구성 요소 (도우미)는 뷰에서 사용됩니다.

그래서 문제에 대한 해결책이 설정되어 또한

public $components = array('Session','DebugKit.Toolbar'); 

당신이 세계적으로 너무 거기에 추가해야 다른 구성 요소를 사용한다면.

+0

좋은 주인, 나는 결코 그것을 얻지 않을 것입니다. 감사! – zmonteca

+0

대장 감사합니다 :) –