當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Template::instance方法代碼示例

本文整理匯總了PHP中Template::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Template::instance方法的具體用法?PHP Template::instance怎麽用?PHP Template::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Template的用法示例。


在下文中一共展示了Template::instance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getInstance

 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
開發者ID:anzasolutions,項目名稱:simlandia,代碼行數:7,代碼來源:template.class.php

示例2: error

 function error($f3)
 {
     $log = new Log('error.log');
     $log->write($f3->get('ERROR.text'));
     foreach ($f3->get('ERROR.trace') as $frame) {
         if (isset($frame['file'])) {
             // Parse each backtrace stack frame
             $line = '';
             $addr = $f3->fixslashes($frame['file']) . ':' . $frame['line'];
             if (isset($frame['class'])) {
                 $line .= $frame['class'] . $frame['type'];
             }
             if (isset($frame['function'])) {
                 $line .= $frame['function'];
                 if (!preg_match('/{.+}/', $frame['function'])) {
                     $line .= '(';
                     if (isset($frame['args']) && $frame['args']) {
                         $line .= $f3->csv($frame['args']);
                     }
                     $line .= ')';
                 }
             }
             // Write to custom log
             $log->write($addr . ' ' . $line);
         }
     }
     Template::instance()->render('error.html');
 }
開發者ID:paspo,項目名稱:installinux,代碼行數:28,代碼來源:misc.php

示例3: post

 public function post()
 {
     $f3 = \Base::instance();
     //        $f3->reroute('/beta');
     // Exit immediately if public registrations are disabled
     if (!DbConfig::getOpt('openRegister')) {
         $f3->error(400);
         return;
     }
     if ($f3->get('POST.register-password') != $f3->get('POST.register-password-verify')) {
         $f3->set('errors', ['Password verify must match the first password.']);
     } else {
         $user = User::createUser(array('name' => $f3->get("POST.register-name"), 'username' => $f3->get("POST.register-username"), 'email' => $f3->get("POST.register-email"), 'password' => $f3->get("POST.register-password")));
         // Data missing
         if ($user == false) {
             $f3->set('errors', ['Some information has not been entered correctly or is not long enough.']);
         } elseif (is_array($user)) {
             $f3->set('errors', $user);
         } else {
             $f3->set('SESSION.id', $user->id);
             $f3->set('tplData', ['name' => $f3->get("POST.register-username")]);
             SendingAPI::send(['mailTo' => $f3->get("POST.register-email"), 'mailSubject' => 'Thank you for registering on SquareMS !', 'mailContents' => ['html' => \Template::instance()->render('mails/register.html'), 'text' => "Thank you for registering on SquareMS ! \n" . "You can access your account now on https://squarems.net/ ! \n\n" . "Please do not respond to this email, it is sent by an automated system."]]);
             $f3->reroute("/dashboard");
             return;
         }
     }
     $f3->set('css', array('/static/css/auth.css'));
     $f3->set('target', 'auth/register.html');
     $this->_render('base.html');
 }
開發者ID:KindlyFire,項目名稱:SquareMS-Web,代碼行數:30,代碼來源:register.php

示例4: getInstance

 static function getInstance()
 {
     if (!Template::$instance) {
         Template::$instance = new Template();
     }
     return Template::$instance;
 }
開發者ID:BackupTheBerlios,項目名稱:newscenter,代碼行數:7,代碼來源:Template.php

示例5: license

 function license()
 {
     $this->view->set('title', 'License');
     $out = Template::instance()->render('basic/sub_license.html');
     $this->view->set('sub_out_put', $out);
     echo Template::instance()->render('basic/main.html');
 }
開發者ID:datameet,項目名稱:openpostbox,代碼行數:7,代碼來源:main.php

示例6: afterroute

 public function afterroute($f3)
 {
     // js view (file)
     $f3->set('jsView', 'setup');
     // render view
     echo \Template::instance()->render($f3->get('PATHFINDER.VIEW.INDEX'));
 }
開發者ID:Quarky9,項目名稱:pathfinder,代碼行數:7,代碼來源:setup.php

示例7: getInstance

 public static function getInstance($path = '')
 {
     if (!isset(self::$instance)) {
         self::$instance = new Template($path);
     }
     return self::$instance;
 }
開發者ID:KTOmega,項目名稱:website,代碼行數:7,代碼來源:template.php

示例8: index

 public function index(\Base $f3, $params)
 {
     $this->response->addTitle($f3->get('LN__AdminMenu_Home'));
     $f3->set('title_h1', $f3->get('LN__AdminMenu_Home'));
     switch ($this->moduleInit(@$params['module'])) {
         case "manual":
             $this->buffer(\View\Base::stub());
             break;
         case "custompages":
             $this->custompages($f3, $params);
             break;
         case "news":
             $this->news($f3, $params);
             break;
         case "modules":
             $this->buffer(\View\Base::stub());
             break;
         case "shoutbox":
             $this->shoutbox($f3, $params);
             break;
         case "home":
             $this->home($f3);
             break;
         default:
             $this->buffer(\Template::instance()->render('access.html'));
     }
 }
開發者ID:eFiction,項目名稱:v5_1-vaporware,代碼行數:27,代碼來源:admincp_home.php

示例9: index

 public function index(\Base $f3, $params)
 {
     $this->response->addTitle($f3->get('LN__AdminMenu_Members'));
     switch ($this->moduleInit(@$params['module'])) {
         case "search":
             $this->buffer(\View\Base::stub());
             break;
         case "pending":
             $this->buffer(\View\Base::stub());
             break;
         case "groups":
             $this->buffer(\View\Base::stub());
             break;
         case "profile":
             $this->profile($f3, $params);
             break;
         case "team":
             $this->team($f3);
             break;
         case "home":
             $this->home($f3);
             break;
         default:
             $this->buffer(\Template::instance()->render('access.html'));
     }
 }
開發者ID:eFiction,項目名稱:v5_1-vaporware,代碼行數:26,代碼來源:admincp_members.php

示例10: upcoming

 public function upcoming()
 {
     $upcoming = new Upcoming($this->db);
     $this->f3->set('decks', $upcoming->all());
     $this->f3->set('content', 'app/views/cards-upcoming.htm');
     echo Template::instance()->render('app/templates/default.htm');
 }
開發者ID:Renako,項目名稱:mytcg-f3,代碼行數:7,代碼來源:CardsController.php

示例11: libraryBookFavMenu

 public static function libraryBookFavMenu(array $menu, array $counter, $sub)
 {
     \Base::instance()->set('menu_upper', $menu);
     \Base::instance()->set('counter', $counter);
     \Base::instance()->set('sub', $sub);
     return \Template::instance()->render('usercp/menu_upper.html');
 }
開發者ID:eFiction,項目名稱:v5_1-vaporware,代碼行數:7,代碼來源:usercp.php

示例12: htmlResponse

 function htmlResponse($title, $html)
 {
     $f3 = Base::instance();
     $f3->set('title', $title);
     $f3->set('view', $html);
     echo Template::instance()->render("layout.html");
 }
開發者ID:Jay-En,項目名稱:Angular-f3,代碼行數:7,代碼來源:Controller.php

示例13: Get

 function Get($f3)
 {
     $f3->set('PHP', version_compare(PHP_VERSION, "5.3.4", "<"));
     $f3->set('message', $f3->get('SESSION.flash'));
     $f3->clear('SESSION.flash');
     echo Template::instance()->render('install.html');
 }
開發者ID:karepwes,項目名稱:OcsPanels,代碼行數:7,代碼來源:install.php

示例14: index

 function index($f3)
 {
     if ($f3->exists("GET.sesi_lenyap")) {
         \Flash::instance()->addMessage('Yoo bang! Selamat jalan~', 'success');
     }
     echo \Template::instance()->render("admin/auth/login.php");
 }
開發者ID:Kekesed,項目名稱:Kambeng-Blog,代碼行數:7,代碼來源:Auth.php

示例15: scriptUpload

 function scriptUpload($f3)
 {
     $this->ensureAdmin($f3);
     $db = $f3->get('db');
     Logger::Info($f3, "AdminPost.scriptUpload", "Starting import...");
     $dummy = $f3->get('FILES');
     $uploadedFile = $dummy["sqlFile"];
     if ($uploadedFile["error"] > 0) {
         Logger::Error($f3, "AdminPost.scriptUpload", $uploadedFile["error"]);
         echo "Error: " . $uploadedFile["error"] . "<br>";
     } else {
         try {
             $db->beginTransaction();
             $importFileName = $f3->get('ROOT') . '/imports/import_' . date('Y-m-d_H\\hi\\m') . '.xlsx';
             copy($uploadedFile["tmp_name"], $importFileName);
             Logger::Info($f3, "AdminPost.scriptUpload", "Import file: " . $importFileName);
             $importResult = ExcelImportExport::importFromExcel2007($db, $uploadedFile["tmp_name"]);
             $db->commit();
             $f3->set('scriptResult', $importResult);
             Logger::Info($f3, "AdminPost.scriptUpload", "Import finished");
         } catch (Exception $e) {
             $db->rollBack();
             $err = ExcelImportExport::$lastExecutedStatement . ' :: ' . $e->getMessage();
             Logger::Error($f3, "AdminPost.scriptUpload", "Import failed: " . $err);
             $f3->set('scriptResult', $err);
         }
         echo Template::instance()->render('adminIndex.htm');
     }
 }
開發者ID:ml26,項目名稱:elternsprechtag,代碼行數:29,代碼來源:AdminPost.php


注:本文中的Template::instance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。