nucleos / matomo-bundle
此扩展包为在 symfony 应用程序中使用 Matomo 提供了一个块服务。
4.2.0
2024-08-14 16:26 UTC
Requires
- php: ^8.1
- ext-json: *
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0 || ^2.0
- psr/log: ^1.0 || ^2.0 || ^3.0
- sonata-project/block-bundle: ^4.21 || ^5.0
- sonata-project/form-extensions: ^1.19 || ^2.0
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/expression-language: ^6.4 || ^7.0
- symfony/form: ^6.4 || ^7.0
- symfony/framework-bundle: ^6.4 || ^7.0
- symfony/http-foundation: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/options-resolver: ^6.4 || ^7.0
- symfony/stimulus-bundle: ^2.2
- symfony/twig-bundle: ^6.4 || ^7.0
- twig/extra-bundle: ^2.0 || ^3.0
- twig/intl-extra: ^2.12 || ^3.0
- twig/twig: ^2.4 || ^3.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.0.1
- nyholm/psr7: ^1.0
- symfony/browser-kit: ^6.4 || ^7.0
- symfony/console: ^6.4 || ^7.0
- symfony/http-client: ^6.4 || ^7.0
- symfony/yaml: ^6.4 || ^7.0
Suggests
- symfony/http-client: Symfony HTTP client implementation
- 4.3.x-dev
- 4.2.x-dev
- 4.2.0
- 4.1.x-dev
- 4.1.0
- 4.0.x-dev
- 4.0.0
- 3.6.x-dev
- 3.5.x-dev
- 3.5.0
- 3.4.x-dev
- 3.4.1
- 3.4.0
- 3.3.x-dev
- 3.3.0
- 3.2.x-dev
- 3.2.0
- 3.1.0
- 3.0.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.1.0
- 1.0.0
- dev-dependabot/npm_and_yarn/assets/express-4.21.0
- dev-renovate/major-eslint-monorepo
- dev-renovate/phpunit-phpunit-11.x
- dev-renovate/matthiasnoback-symfony-dependency-injection-test-6.x
- dev-readme-badge
- dev-3.4.x-merge-up-into-3.5.x_bv9AOp8p
- dev-dependabot/composer/vendor-bin/tools/phpunit/phpunit-9.5.12
- dev-dependabot/composer/vendor-bin/tools/phpstan/phpstan-doctrine-1.2.3
This package is auto-updated.
Last update: 2024-09-21 08:39:02 UTC
README
此扩展包为在 symfony sonata-project 中使用 matomo (Piwik) 统计提供了包装。
安装
打开命令行,进入您的项目目录,并执行以下命令以下载此扩展包的最新稳定版本
composer require nucleos/matomo-bundle
# To define a default http client and message factory
composer require symfony/http-client nyholm/psr7
启用扩展包
然后,通过将其添加到项目 config/bundles.php
文件中注册的扩展包列表中来启用扩展包
// config/bundles.php return [ // ... Nucleos\MatomoBundle\NucleosMatomoBundle::class => ['all' => true], ];
资产
建议使用 webpack / webpack-encore 将 MatomoTable.js
文件包含到您的页面中。这些文件位于 assets
文件夹中。
使用
在您的配置中定义一个 HTTP 客户端。
# config/packages/nucleos_matomo.yaml nucleos_matomo: http: client: 'httplug.client' message_factory: 'nyholm.psr7.psr17_factory'
渲染跟踪代码
{{ sonata_block_render({ 'type': 'nucleos_matomo.block.tracker' }, { 'host': 'http://matomo.example.com', 'site': 1 }) }}
渲染统计图表
{{ sonata_block_render({ 'type': 'nucleos_matomo.block.statistic' }, { 'host': 'http://matomo.example.com', 'site': 1, 'token': 'MATOMO_API_TOKEN' }) }}
许可证
此扩展包受 MIT 许可证 的约束。