Created
September 30, 2014 21:49
-
-
Save mkorostoff/700dbe53e4ca64308577 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* Menu callback for /settings/billing-information/payment-history | |
*/ | |
function _radius_settings_payment_history_menu_callback() { | |
$payment_records = array( | |
array( | |
"name" => "Rohan", | |
"payment_method" => "Amex", | |
), | |
array( | |
"name" => "Matt", | |
"payment_method" => "Visa", | |
), | |
array( | |
"name" => "Eric", | |
"payment_method" => "Mastercard", | |
), | |
); | |
$page = array( | |
'content' => theme('payment_history', array('payment_records' => $payment_records)), | |
); | |
return $page; | |
} |
This file contains hidden or 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 | |
/** | |
* Implements hook_theme(). | |
*/ | |
function radius_settings_theme() { | |
//Override the theme default page.tpl.php | |
return array( | |
"page__settings" => array( | |
"template" => "page--settings", | |
"path" => drupal_get_path('module', 'radius_settings') . '/theme', | |
), | |
"settings__account_preferences__prefix" => array( | |
"template" => "settings--account-preferences--prefix", | |
"path" => drupal_get_path('module', 'radius_settings') . '/theme', | |
), | |
"settings__change_cancel__prefix" => array( | |
"template" => "settings--change-cancel--prefix", | |
"path" => drupal_get_path('module', 'radius_settings') . '/theme', | |
), | |
"payment_history" => array( | |
"template" => "payment-history", | |
"path" => drupal_get_path('module', 'radius_settings') . '/theme', | |
), | |
); | |
} |
This file contains hidden or 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
<!-- payment-history.tpl.php --> | |
<div> | |
<div>hello rohan</div> | |
<?php foreach ($payment_records as $record): ?> | |
<div class="payment-record"> | |
<?php print $record['name']; ?> | |
</div> | |
<div class="payment-method"> | |
<?php print $record['payment_method']; ?> | |
</div> | |
<?php endforeach; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment