PHP code example of se7enxweb / explayouts-site-api
1. Go to this page and download the library: Download se7enxweb/explayouts-site-api 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/ */
se7enxweb / explayouts-site-api example snippets
$loader = new expLayoutsSiteApiItemValueLoader();
$value = $loader->load( 42, 'content' ); // expSiteApiContent or false
$converter = new expLayoutsSiteApiValueConverter();
$item = $converter->convert( $value ); // expLayoutsContentBrowserItem or false
$provider = new expLayoutsSiteApiValueObjectProviderLocation();
$location = $provider->getValueObject( $blockParams['location_id'] );
if ( $location !== null )
{
$converter = new expLayoutsSiteApiValueConverter();
$tpl->setVariable( 'item', $converter->convertToArray( $location ) );
$tpl->setVariable( 'item_url', ( new expLayoutsSiteApiItemValueUrlGenerator() )->generate( $location ) );
}