PHP code example of jellybool / po.et

1. Go to this page and download the library: Download jellybool/po.et library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jellybool / po.et example snippets


// You can get your apiToken from here: https://frost.po.et/token
$poet = new \JellyBool\Poet\Client($apiToken);

$work = $poet->createWork([
    'name' => 'PHP Poet',
    'datePublished' => '2018-02-12T16:39:46+00:00',
    'dateCreated' => '2018-02-12T14:39:46+00:00',
    'author' => 'JellyBool',
    'tags' => 'php',
    'content' => 'Po.et PHP Integrations'
]);

['workId' => '5e11b417b01f0db810d81f7a8f3cbdd13c9b876512a9f26dbd7d380573c700d0']

$poet = new \JellyBool\Poet\Client($apiToken);

$work = $poet->getWork($workId);

[
  'name' => "PHP Poet"
  'datePublished' => "2018-02-12T16:39:46+00:00"
  'dateCreated' => "2018-02-12T14:39:46+00:00"
  'author' => "JellyBool"
  'tags' => "php"
  'content' => "Po.et PHP Integrations"
];

$poet = new \JellyBool\Poet\Client($apiToken);

$work = $poet->getAllWorks();

[
    [
      'name' => "PHP Poet"
      'datePublished' => "2018-02-12T16:39:46+00:00"
      'dateCreated' => "2018-02-12T14:39:46+00:00"
      'author' => "JellyBool"
      'tags' => "php"
      'content' => "Po.et PHP Integrations"
    ],
    [
      'name' => "PHP Poet 2"
      'datePublished' => "2018-02-12T17:39:46+00:00"
      'dateCreated' => "2018-02-12T15:39:46+00:00"
      'author' => "JellyBool"
      'tags' => "po.et"
      'content' => "Po.et interactions with PHP"
    ],
];