PHP code example of netglue / prismic-cli

1. Go to this page and download the library: Download netglue/prismic-cli 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/ */

    

netglue / prismic-cli example snippets



return [
    'primo' => [
        'cli' => [
            'builder' => [
                'source' => __DIR__ . '/../directory/where/plain-php-files-are',
                'dist' => __DIR__ . '/../where-you-want-the-json-files-to-go',
            ],
        ],
        'types' => [
            [
                'id' => 'some-type',
                'name' => 'My Document Type',
                'repeatable' => true,
            ],
        ],
    ],
];


// Local Configuration
return [
    'primo' => [

        // ...

        'custom-type-api' => [
            'token' => 'an access token retrieved from repository settings',
            'repository' => 'my-repo', // The repo name such as "my-repo" as opposed to the full url or "my-repo.prismic.io"
        ],

        // ...
    ],
];

return [
    'prismic' => [
        'api' => 'https://your-repo.cdn.prismic.io/api/v2',
        'token' => null, // Or 'string-access-token'
    ],
];