Exemplo n.º 1
0
 public function actionIndex()
 {
     $model = Capcha::model()->findByPk(1);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Capcha'])) {
         $model->attributes = $_POST['Capcha'];
         if ($model->save()) {
             Yii::app()->user->setFlash('status', 'Изменения сохранены');
         }
     }
     $this->render('index', array('model' => $model));
 }
Exemplo n.º 2
0
 /**
  * 输出声音二进制
  * 请自己扩展
  *
  * @since 1.2.0
  */
 public function audio()
 {
     $this->_captcha = new AudioPhpCaptcha('/usr/bin/flite', 'captcha/');
     $this->_captcha->Create();
 }