PHP code example of pantheon-systems / pantheon-edge-integrations
1. Go to this page and download the library: Download pantheon-systems/pantheon-edge-integrations 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/ */
pantheon-systems / pantheon-edge-integrations example snippets
php
$headerData = new HeaderData();
php
$headerData->getHeader('Audience');
// => "geo:US"
$headerData->getHeader('Interest');
// => "27"
$headerData->getHeader('Role');
// => "subscriber"
php
$headerData->getHeader('Audience');
// => [geo => US]
$headerData->getHeader('Interest');
// => [0 => 27]
$headerData->getHeader('Role');
// => "subscriber"
php
$headerData->returnPersonalizedObject();
// => [
// Audience => [ geo => US ]
// Interest => [ 0 => 27 ]
// Role => subscriber
// ]
php
Pantheon\EI\HeaderData::personalizationObject();
// => [
// Audience => [ geo => US ]
// Interest => [ 0 => 27 ]
// Role => subscriber
// ]
php
Pantheon\EI\HeaderData::parse('Audience');
// => [geo => US]
php
Pantheon\EI\HeaderData::header('Audience');
// => geo:US
php
Pantheon\EI\HeaderData::varyHeader('geo');