Home  >  Article  >  PHP Framework  >  What should I do if the yii1 verification code does not display?

What should I do if the yii1 verification code does not display?

藏色散人
藏色散人Original
2020-07-20 10:04:102061browse

yii1 The verification code is not displayed because the accessRule blocks the verification code. The solution is to add the action of the verification code and then give it visible permissions to everyone.

What should I do if the yii1 verification code does not display?

Specific question:

I added in the controller:

public function filters(){
    return array(
        'accessControl',
    );
}
public function accessRules(){
    return array(
        array(
            'allow',
            'actions' => array('setmessage','actions'),
            'users'=> array('@')
        ),
        array('deny','users'=> array('*')
        )
    );
}

Access control is good Yes, but the verification code is not displayed?

Recommended: "yii Tutorial"

Solution:

Your accessRule blocks the verification code, you Add the verification code action there, and then give it visible permissions to everyone

The above is the detailed content of What should I do if the yii1 verification code does not display?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn