定制 placidapp/placid-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

placidapp/placid-php

最新稳定版本:v1.0.1

Composer 安装命令:

composer require placidapp/placid-php

包简介

PHP Wrapper around the Placid.app REST API

关键字:

README 文档

README

Placid for PHP - Automatic image creation from templates

Placid for PHP

Latest Version Total Downloads

This package enables you to automatically create images from Placid templates. You can use the REST API or the URL API to create placid.app embed links with your variables to dynamically set the image content.

About Placid

To use this package, you will need a Placid account, where you can add, design and edit image templates.

It is a service that automatically creates share images for your content: Open Graph images (og:images), Twitter Card images and Pinterest images. This saves you hours to make your content shareable after publishing. We offer a bunch of nice preset designs you can use out of the box as well.

More than share images: With our editor you have full control over your templates, so you can use it for other types of images to add to your content as well (like teasers or blog graphics).

Installation

You can install this package via composer using this command:

composer require placidapp/placid-php

Create a placid.app image URL

use Placid\Template; $templateId = "qsraj"; $apiKey = "your-placid-api-key"; $template = new Template($templateId, $apiKey) $template ->elementText($title) ->text("I am a dynamic image"); $imageURL = $template->toPlacidUrl(); // - https://placid.app/u/qsraj?title=I%20am%20a%20dynamic%20Image%21

Dynamically created image with Placid

Generate an image

Using the image() function on the template object will result in returning a GeneratedImage Object. When the image has been created, the webhook defined in your config will be called.

 $image = $template->image();

image(true) will wait for the image to being finished:

 $image = $template->image(true); // - https://placid.app/u/qsraj?title=I%20am%20a%20dynamic%20Image%21

Fields

You can add different elements onto your template that can be changed and filled dynamically.

Text field

$template ->elementText("text") // - Layer name in your template ->text("This is the text") ->color('#ff0022'); // - Text color as hex-code

PLEASE NOTE: The text color can only be changed when you use the image() function to generate an image, not if you use the URL API.

Picture field

$template ->elementPicture('picture') // - Layer name in your template ->imageFromUrl( "https://madewithvuejs.com/mandant/madewithvuejs/images/logo.png" // - image source ); $template ->elementPicture('picture') // - Layer name in your template ->imageFromWebsite("https://madewithvuejs.com"); // - URL of a page to screenshot

Browserframe field

$template ->elementBrowserframe('browserframe') // - Layer name in your template ->imageFromUrl( "https://madewithvuejs.com/mandant/madewithvuejs/images/logo.png" // - image source  ) ->url("madewithvuejs.com"); // - URL that will be displayed in the browserframe's address bar $template ->elementBrowserframe('browserframe') // - Layer name in your template ->imageFromWebsite("https://madewithvuejs.com") // - URL of a page to screenshot ->url("madewithvuejs.com"); // - URL that will be displayed in the browserframe's address bar

Rectangle field

$template ->elementRectangle('rectangle') // - Layer name in your template ->backgroundColor("#000000"); // - Background color as hex-code

PLEASE NOTE: The background color can only be changed when you use the image() function to generate an image, not if you use the URL API.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固