Example #1
0
 /**
  * Generate a new Captcha.
  * The phrase contained in the Captcha is automatically placed
  * in the user's session for later verification.
  *
  * @param $width int The width of the generated captcha image.
  * @param $height int The height of the generated captcha image.
  * @return Captcha object for further options and output.
  */
 public static function generate($width = 150, $height = 40)
 {
     $ret = new Captcha();
     $ret->build($width, $height);
     Session::set("CAPTCHA_VALUE", $ret->getPhrase());
     return $ret;
 }