本文整理匯總了PHP中XTemplate::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP XTemplate::getInstance方法的具體用法?PHP XTemplate::getInstance怎麽用?PHP XTemplate::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XTemplate
的用法示例。
在下文中一共展示了XTemplate::getInstance方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public static function init()
{
self::$xtpl = XTemplate::getInstance();
self::$xtpl->restart('template/install.tpl');
self::$xtpl->assign('VERSION', iVersion);
}
示例2: Invoice
public static function Invoice($invdata, $defgw = NULL)
{
$currency = NULL;
$oparray = array();
$xtpl = XTemplate::getInstance();
$gm = GatewayModule::getInstance();
$setting = Settings::getInstance();
$curr = Currency::getInstance();
$user = User::getInstance();
$xtpl->restart("themes/simpla/invoice.tpl");
if (count($invdata) < 2) {
$xtpl->parse('inverror');
} else {
$gmodules = $gm->GetButch();
if ($defgw == NULL) {
$defgw = $setting->Get('system.paygateway.default');
}
$prov = call_user_func(array($gm->GetName($defgw) . "PaymentGateway", 'getInstance'));
$gwdata = $gm->FetchData($defgw);
if (strlen($gwdata['currency']) != 3) {
$currs = $curr->GetButch();
for ($i = 0; $i < count($currs); $i++) {
if (in_array($currs[$i]['name'], $prov->Currency())) {
if ($setting->Get('system.currency') == $currs[$i]['name'] || $currency == NULL) {
$currency = $currs[$i];
}
}
}
} else {
$currency = $curr->FetchData($curr->GetID($gwdata['currency'], 'name'));
//$currency = $curr->GetCurrency('', $gwdata['currency']);
}
$xtpl->assign('CURR', $currency);
$xtpl->assign('AMOUNT', $curr->FormatCurrency($invdata['amount'], $currency['id']));
$data_array['userdata'] = $user->FetchData($invdata['accountid']);
$data_array['invoice'] = $invdata;
$data_array['currency'] = $currency['name'];
$data_array['invoice']['amount'] = $curr->FormatCurrency($invdata['amount'], $currency['id'], -1, true);
$oparray = unserialize($gwdata['data']);
$xtpl->assign('FORM', $prov->Form($oparray, $data_array));
for ($i = 0; $i < count($gmodules); $i++) {
$prov = call_user_func(array($gmodules[$i]['modulename'] . "PaymentGateway", 'getInstance'));
if ($defgw == $gmodules[$i]['id']) {
$xtpl->assign('DEFAULT', 'selected="selected"');
} else {
$xtpl->assign('DEFAULT', '');
}
$xtpl->assign('GM', $gmodules[$i]);
$ginfo = $prov->Info();
$xtpl->assign('GNAME', $ginfo['name']);
$xtpl->parse('main.gwlist');
}
}
$xtpl->assign('INV', $invdata);
$xtpl->parse('main');
$xtpl->out('main');
}