PHP code example of jmsfwk / adf-builder

1. Go to this page and download the library: Download jmsfwk/adf-builder 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/ */

    

jmsfwk / adf-builder example snippets


use Jmsfwk\Adf\Document;

$doc = new Document();
$doc->paragraph()
    ->text('See the ')
    ->link('documention', 'https://example.com')
    ->text(' ')
    ->emoji('smile');

$doc = new Document();
$doc->toJson();      // Returns a compact JSON string
json_encode($doc); // Equivalent to '$doc->toString()'

use Jmsfwk\Adf\Document;

$doc = new Document();
$doc->paragraph()
    ->text('Hello ')
    ->mention($id, 'joe')
    ->text(', please ')
    ->em('carefully')
    ->text(' read ')
    ->link('this contract', 'https://www.example.com/contract');