yii\web\User::checkRedirectAcceptable PHP 메소드

checkRedirectAcceptable() 보호된 메소드

The login page is assumed to serve text/html or application/xhtml+xml by default. You can change acceptable content types by modifying [[acceptableRedirectTypes]] property.
또한 보기: acceptableRedirectTypes
부터: 2.0.8
protected checkRedirectAcceptable ( ) : boolean
리턴 boolean whether this request may be redirected to the login page.
    protected function checkRedirectAcceptable()
    {
        $acceptableTypes = Yii::$app->getRequest()->getAcceptableContentTypes();
        if (empty($acceptableTypes) || count($acceptableTypes) === 1 && array_keys($acceptableTypes)[0] === '*/*') {
            return true;
        }
        foreach ($acceptableTypes as $type => $params) {
            if (in_array($type, $this->acceptableRedirectTypes, true)) {
                return true;
            }
        }
        return false;
    }