当前位置: 首页>>代码示例>>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;未经允许,请勿转载。