Created
April 16, 2013 04:30
-
-
Save drmmr763/5393355 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:variable name="identifier"><xsl:value-of select="field_identifier" /></xsl:variable> | |
<h1><xsl:value-of select="php:function('Restaurant::getRestaruantData', $identifier)" disable-output-escaping="yes"/></h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function getRestaurantData($identifier) | |
{ | |
// get data from API | |
$json_data = "https://mydatasource.com/api/data=".$identifier; | |
$data = json_decode($json_data); | |
foreach ($data as $item) | |
{ | |
$html .= '<div class="rating">'.$item->rating.'</div>'; | |
$html .= '<div class="reviews>'.$item->reviews.'</div>'; | |
} | |
return $html; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment