public function onLoad() { parent::onLoad(); try { $captcha = \Amun\Captcha::factory($this->config['amun_captcha']); $captcha->serve(); exit; } catch (Exception $e) { header('Content-type: image/png'); $im = imagecreatetruecolor(300, 57); $textcolor = imagecolorallocate($im, 0, 0, 0); $bgcolor = imagecolorallocate($im, 255, 255, 255); imagefill($im, 0, 0, $bgcolor); imagestring($im, 3, 4, 4, $e->getMessage(), $textcolor); imagepng($im); imagedestroy($im); } }
public function onLoad() { parent::onLoad(); $this->fm = $this->getFormManager(); }