TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Kolanos captcha module not displaying image
  • Hi guys, I am 2 week-old in Kohana but I have quite a long experience with PHP, Zend, Yii & co. So I'm still missing nuts & bolts of Kohana, even more when it's about modules. For short, I've installed the Kolanos captcha module, done the modifs as here: http://forum.kohanaframework.org/discussion/comment/79087 (in fact I did it before reading, just error-driven), configured the module in bootstrap.php, copied the module's config file into the application's /config. And that's all. In the controller it seems it goes fine but what I'm getting in the view is an image placeholder pointing to this: - img src="/captcha/default" width="150" height="50" alt="Captcha" class="captcha" - instead of the image. What am I doing wrong? Thx

  • render in view, not in controller

  • I don't understand. If you mean $captcha->render(), of course it would be in the view. What I'm doing is this: - in controller $captcha = Captcha::instance(); $view = View::factory('login/index'); $this->view->captcha = $captcha; .... -in view ...... I've also tried with $captcha->render() instead of echo-ing, I've got the same result ...

  • in view

    <?php echo Captcha::instance()->image_render(TRUE) ?>


    < img src="<?php echo Route::url('captcha') ?>" alt="Captcha" class="captcha" >
  • Nope, same result ...

  • Ok, I think it comes-up now: how should I define the route in bootstrap (because I didn't ...)?

  • @Opariti route already in modules folder in init.php

    try use this version https://github.com/WinterSilence/kohana-captcha work correctly 100%

  • Ok, thanks, be back to you soon ...

  • @WinterSilence: It renders the image! However, there is a minor error that you have to fix in the code - declare the class 'abstract' in classes/Captcha.php; it's caught up by error handler anyway, but is better to be all clean. Many thanks! Be back to you after testing the validation :-)

  • @WinterSilence: Ok, I still need to handle the captcha post for validation, but that's fine, it's on my side now, your version works fine. Many thanks!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion