我使用验证码组件从http://www.devarticles.in/验证码组件读会话错误
我已经进口的验证码组件像
App::import('Component', 'Captcha'); //load it
$this->Captcha = new CaptchaComponent(new ComponentCollection()); //make instance
$this->Captcha->startup($this);
但是当我尝试调用功能
$captcha = $this->Captcha->getVerCode();
它给我错误为
Call to a member function read() on a non-object in C:\xampp\htdocs\westudy_old\app\Controller\Component\CaptchaComponent.php on line 65
我的组件的功能组件的
function getVerCode() {
return $this->Controller->Session->read('security_code');
}
和启动功能
function startup() {
$this->Controller = $this->_controller;
}