久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      yii 驗證碼不顯示圖片怎么辦

      yii 驗證碼不顯示圖片怎么辦

      yii 驗證碼不顯示圖片怎么辦?

      yii2中驗證碼的使用-圖片不顯示

      推薦學(xué)習(xí):yii框架

      1.控制器中

      public function actions()     {         return [             'captcha' => [                 'class' => 'yiicaptchaCaptchaAction',                 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,             ],         ];     }

      2.模型中

      要有一個驗證碼的字段$verifyCode

      3.視圖中

      use yiihelpersHtml; use yiiwidgetsActiveForm; use yiicaptchaCaptcha;

      自動生成表單

      頁面中驗證碼代碼

      <?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [                     'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>', ]) ?>

      控制器中的權(quán)限可能導(dǎo)致驗證碼圖片不顯示,

      public function behaviors()

      {

      return [

      'access' => [

      'class' => AccessControl::className(),

      'only' => ['logout', 'signup','login'],

      'rules' => [

      [

      'actions' => ['signup'],

      'allow' => true,

      'roles' => ['?'],

      ],

      [

      'actions' => ['logout'],

      'allow' => true,

      'roles' => ['@'],

      ],

      ],

      ],

      'verbs' => [

      'class' => VerbFilter::className(),

      'actions' => [

      'logout' => ['post'],

      ],

      ],

      ];

      }

      控制器中紅線部分缺少則導(dǎo)致驗證碼不顯示。

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號