fond-of-spryker / google-site-verification
1.0.0
2020-03-11 11:27 UTC
Requires
- php: >=7.2
Requires (Dev)
- codeception/codeception: ^2.5
- mikey179/vfsstream: ^1.6
- php-coveralls/php-coveralls: ^2.0
- phpro/grumphp: ^0.14
- sebastian/phpcpd: ^4.1
- spryker/code-sniffer: ^0.14.7
This package is auto-updated.
Last update: 2024-09-11 20:57:27 UTC
README
描述
将 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 移动到小部件中,而不是将密钥作为全局变量传递