We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ahoy,
i'm trying to implement your component but i've a little issue.
here's my code on CommentController.php
class CommentsController extends AppController {
public $name = 'Comments'; public $helpers = array('Html', 'Form', 'Session'); public $components = array('MathCaptcha','RequestHandler'); public function add($post_id = null) { $this->set('captcha', $this->MathCaptcha->getCaptcha()); if ($this->request->is('post')) { $this->Comment->set(array('post_id'=>$post_id)); $this->request->data['Comment']['ip'] = $this->RequestHandler->getClientIp(); if ($this->MathCaptcha->validate($this->request->data['Comment']['captcha'])) { $this->Session->setFlash("ok.","notif"); $this->redirect(array('controller' => 'posts', 'action' => 'view', $post_id)); } else { $this->Session->setFlash("ko.","notif"); } } }
}
and my view
but when i refresh i've an error who say:
Notice (8): Undefined variable: captcha [APP\View\Elements\newcomment.ctp, line 13] (my line 13 is the line before
don't know why sadly ... can you please help me?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ahoy,
i'm trying to implement your component but i've a little issue.
here's my code on CommentController.php
class CommentsController extends AppController {
}
and my view
Form->input('captcha', array('label' => 'Calculate this: '.$captcha)); ?>but when i refresh i've an error who say:
Notice (8): Undefined variable: captcha [APP\View\Elements\newcomment.ctp, line 13]
(my line 13 is the line before
don't know why sadly ... can you please help me?
The text was updated successfully, but these errors were encountered: