当前位置: 首页>>代码示例>>PHP>>正文


PHP XTemplate::getInstance方法代码示例

本文整理汇总了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);
 }
开发者ID:carriercomm,项目名称:Multicabinet,代码行数:6,代码来源:class.Page.php

示例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');
 }
开发者ID:carriercomm,项目名称:Multicabinet,代码行数:57,代码来源:class.Page.php


注:本文中的XTemplate::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。