yii\helpers\BaseHtml::csrfMetaTags PHP 메소드

csrfMetaTags() 공개 정적인 메소드

Generates the meta tags containing CSRF token information.
또한 보기: Request::enableCsrfValidation
public static csrfMetaTags ( ) : string
리턴 string the generated meta tags
    public static function csrfMetaTags()
    {
        $request = Yii::$app->getRequest();
        if ($request instanceof Request && $request->enableCsrfValidation) {
            return static::tag('meta', '', ['name' => 'csrf-param', 'content' => $request->csrfParam]) . "\n    " . static::tag('meta', '', ['name' => 'csrf-token', 'content' => $request->getCsrfToken()]) . "\n";
        } else {
            return '';
        }
    }