I am trying to implement visualCaptcha in V3. If you go to the link you’ll see the developers of visual captcha has given example with slim v2. While I have implemented some parts of it well I am having some difficultly translating some of the code so v3 understands it.
Any help would be appreciated.
To add extra context I am trying to implement the function
$app->get( '/image/:index', function( $index ) use( $app ) {
$captcha = new \visualCaptcha\Captcha( $app->session );
if ( ! $captcha->streamImage(
$app->response,
$index,
$app->request->params( 'retina' )
) ) {
$app->pass();
}
} );
Whereas I have currently,
Router.php
$this->app->get( '/image/{index}', 'VisualCaptchaController:index' );
VisualCaptchaController.php
public function index ($request, $response, $args) {
$captcha = new \visualCaptcha\Captcha ($this->getCaptchaSession());
$captcha->streamImage ($response, $args['index'], $this->container->getParam('retina'));
}