-
-
Save justinm/1202740 to your computer and use it in GitHub Desktop.
global scope variable
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 | |
if(!empty($social_dialog)): //Step 4: Ok, was anything generated during that pages/element loop? | |
echo $social_dialog; //print out the html string generated if so... | |
endif; | |
?> |
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 | |
function createSharingDialog($services) //Step 2: Build the dialog and save it to a var for later use | |
{ | |
$social_dialog = "<div data-role='dialog' id='share_dialog'>"; | |
$social_dialog .= "<div data-role='header'><h2>Share</h2></div>"; | |
$social_dialog .= "<div data-role='content'>"; | |
foreach($services as $item): | |
$social_dialog .= buildSharingLink($item); | |
endforeach; | |
$social_dialog .= "</div>"; | |
$social_dialog .= "</div>"; | |
return $social_dialog; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment