http://www.devarticles.in/のCaptchaコンポーネントを使用しています
私は次のようなキャプチャコンポーネントをインポートしました
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;
}