mongroove/avetec-php
Composer 安装命令:
composer require mongroove/avetec-php
包简介
A client library for generating image URLs with Avetec.
关键字:
README 文档
README
avetec-php
A php client library for generating image URLs with avetec
Installation
You can install the package via composer:
composer require mongroove/avetec-php
Usage
To begin creating avetec URLs programmatically, add the php files to your project. The URL builder can be reused to create URLs for any images on the domains it is provided.
use Avetec\UrlBuilder; $urlBuilder = new UrlBuilder("example.domain.com", 'your-secret-key'); $params = array("w" => 500, "h" => 500); echo $urlBuilder->createURL("856c4490-784f-4a8e-a918-aa66c0398a9q", 'png', $params); // 'https://example.domain.com/856c4490-784f-4a8e-a918-aa66c0398a9q.png?h=500&w=500'
Advanced functions
Base64 Params
The parameters can be bundled and output with an encrypted base64 parameter, call setUseBase64 on the builder.
$urlBuilder->setUseBase64(true); echo $urlBuilder->createURL("856c4490-784f-4a8e-a918-aa66c0398a9q", 'png', $params); // https://example.domain.com/v1/856c4490-784f-4a8e-a918-aa66c0398a9q.png?bc=eyJ3Ijo1MDAs...
Add slug
To pass a slug, an additional parameter can be inserted as follows.
echo $urlBuilder->createURL("856c4490-784f-4a8e-a918-aa66c0398a9q", 'png', $params, 'special'); // 'https://example.domain.com/special/856c4490-784f-4a8e-a918-aa66c0398a9q.png'
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2024-10-07