Skip to content

Instantly share code, notes, and snippets.

@jessevondoom
Last active August 29, 2015 14:13
Show Gist options
  • Save jessevondoom/39eaf1bb6fb84b5c1cd9 to your computer and use it in GitHub Desktop.
Save jessevondoom/39eaf1bb6fb84b5c1cd9 to your computer and use it in GitHub Desktop.
<?php
/**
* Sample element
*
* @package downloadcodes.org.cashmusic
* @author CASH Music
* @link http://cashmusic.org/
*
* Copyright (c) 2015, CASH Music
* Licensed under the Affero General Public License version 3.
* See http://www.gnu.org/licenses/agpl-3.0.html
*
**/
class SampleElement extends ElementBase {
public $type = 'sampleelement';
public $name = 'Sample Element';
public function getData() {
if ($this->status_uid == 'asset_redeemcode_400') {
// problem in the response? Define an error, show default template
$this->element_data['error_message'] = 'Nope.';
} elseif ($this->status_uid == 'asset_redeemcode_200') {
// got the response we want? yay! show the success template
$this->element_data['success_message'] = 'You did it!';
$this->setTemplate('success');
}
return $this->element_data;
}
} // END class
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment