承接 ipeevski/metabase-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ipeevski/metabase-php

最新稳定版本:0.3.0

Composer 安装命令:

composer require ipeevski/metabase-php

包简介

Embedding Metabase

关键字:

README 文档

README

Library to embed Metabase frames

Installation

  • Install via composer composer require ipeevski/metabase-php
  • Go to Metabase and enable embedding - https://[metabase_url]/admin/settings/embedding_in_other_applications
  • Note down the Metabase base url and the Embedding secret key

Usage

Basic usage

First, you need to find the dashboard or question you want to embed. Note down the id - it would be at the end of the URL (for example https://[metabase_url]/dashboard/1?date=past26weeks

Note the integer after /dashboard/ - that's the ID of the dashboard. Also note the GET parameters at the end of the url - those are parameters you might want to pass to the dashboard too.

<?php
include 'vendor/autoload.php';

// The url of the metabase installation
$metabaseUrl = '[metabase_url]';
// The secret embed key from the admin settings screen
$metabaseKey = '[metabase_key]';
// The id of the dashboard (from the url)
$dashboardId = 1;
// Any parameters to pass to the dashboard
$params = ['date' => 'past26weeks'];

$metabase = new \Metabase\Embed($metabaseUrl, $metabaseKey);
// Generate the HTML to create an iframe with the embedded dashboard
echo $metabase->dashboardIframe($dashboardId, $params);

统计信息

  • 总下载量: 130.07k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 24
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 24
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-13