fond-of-spryker/google-site-verification

1.0.0 2020-03-11 11:27 UTC

This package is auto-updated.

Last update: 2024-09-11 20:57:27 UTC


README

Build Status PHP from Travis config license

描述

将 Google 网站验证密钥作为模板变量(google_site_verification_key)添加到 twig。

安装

composer require fond-of-spryker/google-site-verification

将 GoogleSiteVerificationTwigPlugin 注册到 TwigDependencyProvider

protected function getTwigPlugins(): array
    {
        return [
            ...
            new GoogleSiteVerificationTwigPlugin(),
        ];
    }

用法

在模板中使用它

{% if google_site_verification_key != ''%}<meta name="google-site-verification" content="{{ google_site_verification_key }}" />{% endif %}

待办事项

由于是从旧的 ShopApplicationServiceProvider 中提取出来的,因此将 addGlobalTemplateVariables 移动到小部件中,而不是将密钥作为全局变量传递