PHP code example of level51 / silverstripe-tripadvisor

1. Go to this page and download the library: Download level51/silverstripe-tripadvisor 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/ */

    

level51 / silverstripe-tripadvisor example snippets


// Fetch location profile and output number of visits
$profile = TripAdvisorLocationProfile::current();
echo $profile->NumVisits;

// Fetch reviews and render with custom template
return TripAdvisorReview::get()->renderWith('ReviewGrid');