Skip to content

Commit 6b022b7

Browse files
Merge pull request #114 from renderforest/refactor-and-template-svg
refactor-and-template-svg
2 parents 3e952b8 + 5096582 commit 6b022b7

File tree

18 files changed

+497
-220
lines changed

18 files changed

+497
-220
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Welcome to the Renderforest API! You can use our API to:
8383
- [Get Pluggable-Screens of the Template](#get-pluggable-screens-of-the-template)
8484
- [Get Recommended-Custom-Colors of the Template](#get-recommended-custom-colors-of-the-template)
8585
- [Get Template-Presets of the Template](#get-template-presets-of-the-template)
86+
- [Get SVG Content of the Template](#get-svg-content-of-the-template)
8687
- [Get Theme of the Template](#get-theme-of-the-template)
8788
- [Get Transitions of the Template](#get-transitions-of-the-template)
8889
* [Users API](#users-api)
@@ -1105,6 +1106,29 @@ Template-presets are ready-made stories created from this template to fasten you
11051106
[See example](https://github.com/renderforest/renderforest-sdk-php/blob/master/examples/templates/get-template-presets.php)
11061107

11071108

1109+
### Get SVG Content of the Template
1110+
Retrieves SVG content of the template.
1111+
1112+
```php
1113+
<?php
1114+
1115+
require 'vendor/autoload.php';
1116+
1117+
$payload = [
1118+
'templateId' => 701
1119+
];
1120+
try {
1121+
$templateSVGContent = \Renderforest\Client::getTemplateSVGContent($payload);
1122+
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
1123+
var_dump($e); // handle the error
1124+
}
1125+
1126+
var_dump($templateRecommendedCustomColors); // handle the success
1127+
```
1128+
1129+
[See example](https://github.com/renderforest/renderforest-sdk-php/blob/master/examples/templates/get-template-svg-content.php)
1130+
1131+
11081132
### Get Theme of the Template
11091133

11101134
Retrieves theme of the template.
@@ -1187,4 +1211,4 @@ var_dump($currentUser); // handle the success
11871211
Example for creating project from scratch. Includes creating project, updating project data, video rendering status
11881212
checking and video downloading.
11891213

1190-
[See example](https://github.com/renderforest/renderforest-sdk-php/blob/master/examples/scratch-project/create-project-from-scratch.php)
1214+
[See example](https://github.com/renderforest/renderforest-sdk-php/blob/master/examples/scratch-project/create-project-from-scratch.php)

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "renderforest/sdk-php",
33
"description": "Renderforest SDK for PHP",
4-
"version": "0.3.7",
4+
"version": "0.3.8",
55
"homepage": "https://github.com/renderforest/renderforest-sdk-php",
66
"authors": [
77
{
@@ -24,8 +24,9 @@
2424
"video maker"
2525
],
2626
"require": {
27-
"php": ">=5.5",
28-
"guzzlehttp/guzzle": "6.3.3"
27+
"php": ">=7.1",
28+
"guzzlehttp/guzzle": "6.3.3",
29+
"ext-json": ""
2930
},
3031
"autoload": {
3132
"psr-4": {

composer.lock

Lines changed: 55 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2018-present, Renderforest, LLC.
4+
* All rights reserved.
5+
*
6+
* This source code is licensed under the license found in the
7+
* LICENSE file in the root directory.
8+
*/
9+
10+
require 'vendor/autoload.php';
11+
12+
$payload = [
13+
'templateId' => 701
14+
];
15+
try {
16+
$templateSVGContent = \Renderforest\Client::getTemplateSVGContent($payload);
17+
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
18+
var_dump($e); // handle the error
19+
}
20+
21+
var_dump($templateRecommendedCustomColors); // handle the success

examples/users/get-current-user.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
require 'vendor/autoload.php';
1111

12-
$options = ['signKey' => '<signKey>', 'clientId' => -1];
13-
14-
$renderforest = new \Renderforest\Client($options);;
12+
$renderforest = new \Renderforest\Client(['signKey' => '<signKey>', 'clientId' => -1]);
1513

1614
try {
1715
$currentUser = $renderforest->getCurrentUser();

0 commit comments

Comments
 (0)