emanueleminotto / embedly-module
Zend Framework 2的Embed.ly模块
1.1.0
2015-03-07 12:59 UTC
Requires
- emanueleminotto/embedly: ~1.1
- guzzlehttp/guzzle: ~5.2
- zendframework/zendframework: ~2.3
Requires (Dev)
- phpunit/phpunit: ~4.5
This package is auto-updated.
Last update: 2024-08-28 06:36:35 UTC
README
基于embed.ly库的Embedly的Zend Framework 2模块。
API: emanueleminotto.github.io/EmbedlyModule
安装
打开命令行,进入你的项目目录,并执行以下命令以下载此模块的最新稳定版本
$ composer require emanueleminotto/embedly-module
此命令要求你全局安装Composer,如Composer文档中的安装章节所述。
使用方法
// EmanueleMinotto\Embedly\Client instance $embedly = $this->getServiceLocator()->get('embedly');
配置
此模块不需要配置即可使用,但您可以添加一个API密钥和Guzzle 5客户端的引用。
return array( 'embedly' => array( 'api_key' => 'xxxxxxxx', 'http_client' => 'guzzle_client_service_reference', ), );
视图助手
此模块提供了一个视图助手,方法embedlyDisplay
类似于库的display
方法(ref)。
<img src="<?php echo $this->embedlyDisplay('resize', [ 'url' => 'http://placehold.it/500', 'width' => 100, 'height' => 100, ]); ?>" />