/** * Attach Recaptcha helper to Controller. * * @param Controller $controller Controller. * * @return void */ public function setController($controller) { // Add the helper on the fly if (!in_array('Recaptcha.Recaptcha', $controller->viewBuilder()->helpers())) { $controller->viewBuilder()->helpers(['Recaptcha.Recaptcha'], true); } }