本文整理汇总了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');
}