nucleos/matomo-bundle
最新稳定版本:4.4.0
Composer 安装命令:
composer require nucleos/matomo-bundle
包简介
This bundle provides a block service for using Matomo inside symfony applications.
关键字:
README 文档
README
This bundle provides a wrapper for using the matomo (Piwik) statistic inside the symfony sonata-project.
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
composer require nucleos/matomo-bundle
# To define a default http client and message factory
composer require symfony/http-client nyholm/psr7
Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in config/bundles.php file of your project:
// config/bundles.php return [ // ... Nucleos\MatomoBundle\NucleosMatomoBundle::class => ['all' => true], ];
Assets
It is recommended to use webpack / webpack-encore
to include the MatomoTable.js file in your page. These file is located in the assets folder.
You can use npm or yarn to load the library:
Usage
Define a http client in your configuration.
# config/packages/nucleos_matomo.yaml nucleos_matomo: http: client: 'httplug.client' message_factory: 'nyholm.psr7.psr17_factory'
Render tracking code
{{ sonata_block_render({ 'type': 'nucleos_matomo.block.tracker' }, {
'host': 'http://matomo.example.com',
'site': 1
}) }}
Render statistic graph
{{ sonata_block_render({ 'type': 'nucleos_matomo.block.statistic' }, {
'host': 'http://matomo.example.com',
'site': 1,
'token': 'MATOMO_API_TOKEN'
}) }}
License
This bundle is under the MIT license.
统计信息
- 总下载量: 1.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-26