inquid / yii2-spotify
spotify, yii2 框架的实用工具
v0.1
2018-02-21 06:12 UTC
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-08-29 04:33:17 UTC
README
yii2 Inquid Spotify
yii2 框架的 spotify 实用工具
安装
安装此扩展的首选方式是通过 composer。
运行以下命令:
php composer.phar require --prefer-dist inquid/yii2-spotify "*"
或添加以下内容到您的 composer.json
文件的 require 部分:
"inquid/yii2-spotify": "dev-master"
使用方法
扩展安装完成后,只需在您的代码中使用它即可
<?= \inquid\spotify\SpotifyWidget::widget(['song' => '/* paste here your spotify uri */']); ?>
可用参数:-song -theme -view -width -height -frameBorder -transparency
- 例如,歌曲参数是必需的:spotify:track:5O31BTWa4XNFtE3zVgeCoh
示例
代码
<?= \inquid\spotify\SpotifyWidget::widget(['song' => 'spotify:track:2QB1chgLUjo4K5JwODVue1', 'height' => 400, 'width' => 400]); ?>
有关更多信息,请参阅以下链接: https://developer.spotify.com/technologies/widgets/spotify-play-button/