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


PHP Template::display方法代码示例

本文整理汇总了PHP中Template::display方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::display方法的具体用法?PHP Template::display怎么用?PHP Template::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Template的用法示例。


在下文中一共展示了Template::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayTemplate

function displayTemplate($title, $template, $vars)
{
    $t = new Template($title);
    $t->display('header');
    if (is_array($vars)) {
        foreach ($vars as $var => $val) {
            $t->assignVar($var, $val);
        }
    }
    $t->display($template);
    $t->display('footer');
}
开发者ID:BackupTheBerlios,项目名称:saiko-svn,代码行数:12,代码来源:functions.php

示例2: index

function index()
{
    include "header.php";
    global $db, $lang, $prefix;
    $tpl = new Template();
    $tpl->modTemplate("package");
    $continent = intval($_GET["continent"]);
    if (!empty($continent)) {
        $cond = " AND package_continent={$continent}";
    }
    $result = $db->query("SELECT *  FROM " . $prefix . "_package  WHERE  package_active=1 {$cond}");
    $num_record = $db->row_count($result);
    if ($num_record < 1) {
        $tpl->display("no_package.tpl");
        include "footer.php";
        exit;
    }
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 20;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=package", $page, $pages);
    } else {
        $page_link = "";
    }
    $result2 = $db->query("SELECT * FROM " . $prefix . "_package  WHERE package_active=1 {$cond} ORDER BY package_id DESC limit {$start},{$perpage}");
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $num_record);
    $tpl->assign("currentpage", $currentpage);
    while ($row = $db->fetch_array($result2)) {
        $package[] = $row;
    }
    $tpl->assign("lang", $lang);
    $tpl->assign("package", $package);
    $tpl->display("package.tpl");
    include "footer.php";
}
开发者ID:bogiesoft,项目名称:TravelAgentv2,代码行数:51,代码来源:index.php

示例3: detail

 public function detail($targetid, $display = true)
 {
     $this->targetid = $targetid;
     $sparams = array('id' => $this->targetid, 'block' => $this->module, 'contactid' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']);
     $lmod = $GLOBALS["sclient"]->call('get_details', $sparams);
     //echo '<h2>request</h2><pre>' . htmlspecialchars($GLOBALS["sclient"]->response, ENT_QUOTES) . '</pre>';
     foreach ($lmod[0][$this->module] as $ticketfield) {
         $fieldlabel = $ticketfield['fieldlabel'];
         $fieldvalue = $ticketfield['fieldvalue'];
         $blockname = $ticketfield['blockname'];
         if (!isset($mod_infos[$blockname])) {
             $mod_infos[$blockname] = array();
         }
         $mod_infos[$blockname][] = array("label" => $fieldlabel, "value" => $fieldvalue);
     }
     $docs = $this->get_documents();
     if (isset($docs) && count($docs) > 0) {
         $mod_infos = array_merge($mod_infos, $docs);
     }
     $data['recordinfo'] = $mod_infos;
     if ($display) {
         Template::display($this->module, $data, 'detail');
     } else {
         return $mod_infos;
     }
 }
开发者ID:Bergdahls,项目名称:YetiForcePortal,代码行数:26,代码来源:index.php

示例4: main

 public static function main($tmplData)
 {
     //echo "Render::main()";
     global $ini;
     $tmplData['{{content}}'] = Template::render($ini['mainTemplate'], $tmplData);
     Template::display($ini['layoutTemplate'], $tmplData);
 }
开发者ID:Kloadut,项目名称:phpFileManager,代码行数:7,代码来源:Render.php

示例5: formAction

 /**
  * Handle form action
  */
 protected function formAction()
 {
     switch ($this->s->action) {
         case 'reload':
             // element: submenu
             $this->s->resetParams('form');
             $module = $this->s->loadModule($this->s->controller);
             $tpl = new Template('system');
             $tpl->assign('subnav', $this->generateNav($module->getSection()));
             $tpl->display('submenu.html');
             return true;
             break;
         case 'submenu':
             if ($this->s->element == '') {
                 Error::addWarning('Fehler: ID des Untermenüs ist nicht definiert!');
                 return false;
             }
             $section = str_replace('nav_', '', $this->s->element);
             $this->s->resetParams();
             $tpl = new Template('system');
             $tpl->assign('subnav', $this->generateNav($section));
             $tpl->display('submenu.html');
             return true;
             break;
         case 'cleanlog':
             if ($this->s->element == 'error') {
                 $file = fopen("logs/error.log", "w+");
                 fclose($file);
             }
             return true;
             break;
     }
 }
开发者ID:anhvn,项目名称:pokerspot,代码行数:36,代码来源:backend.class.php

示例6: get_list

 public function get_list()
 {
     $params = array('id' => $_SESSION["loggeduser"]['id'], 'type' => $GLOBALS["summary_widgets"]);
     $result = $GLOBALS["sclient"]->call('get_summary_widgets', $params);
     //echo '<h2>request</h2><pre>' . htmlspecialchars($GLOBALS["sclient"]->response, ENT_QUOTES) . '</pre>';
     $data['widgets'] = $result != false && $result[0] != '' ? $result[0] : array();
     Template::display($this->module, $data, 'index');
 }
开发者ID:Bergdahls,项目名称:YetiForcePortal,代码行数:8,代码来源:index.php

示例7: index

 public function index()
 {
     $user = System::getUser();
     $form = new Form('form-profile');
     $form->setAttribute('data-noajax', 'true');
     $form->binding = $user;
     $fieldset = new Fieldset(System::getLanguage()->_('General'));
     $firstname = new Text('firstname', System::getLanguage()->_('Firstname'));
     $firstname->binding = new Databinding('firstname');
     $lastname = new Text('lastname', System::getLanguage()->_('Lastname'));
     $lastname->binding = new Databinding('lastname');
     $email = new Text('email', System::getLanguage()->_('EMail'), true);
     $email->binding = new Databinding('email');
     $email->blacklist = $this->getListOfMailAdresses($user);
     $email->error_msg[4] = System::getLanguage()->_('ErrorMailAdressAlreadyExists');
     $language = new Radiobox('lang', System::getLanguage()->_('Language'), L10N::getLanguages());
     $language->binding = new Databinding('lang');
     $fieldset->addElements($firstname, $lastname, $email, $language);
     $form->addElements($fieldset);
     $fieldset = new Fieldset(System::getLanguage()->_('Password'));
     $password = new Password('password', System::getLanguage()->_('Password'));
     $password->minlength = PASSWORD_MIN_LENGTH;
     $password->binding = new Databinding('password');
     $password2 = new Password('password2', System::getLanguage()->_('ReenterPassword'));
     $fieldset->addElements($password, $password2);
     $form->addElements($fieldset);
     $fieldset = new Fieldset(System::getLanguage()->_('Settings'));
     $quota = new Text('quota', System::getLanguage()->_('Quota'));
     if ($user->quota > 0) {
         $quota->value = System::getLanguage()->_('QuotaAvailabe', Utils::formatBytes($user->getFreeSpace()), Utils::formatBytes($user->quota));
     } else {
         $quota->value = System::getLanguage()->_('Unlimited');
     }
     $quota->readonly = true;
     $fieldset->addElements($quota);
     $form->addElements($fieldset);
     if (Utils::getPOST('submit', false) !== false) {
         if (!empty($password->value) && $password->value != $password2->value) {
             $password2->error = System::getLanguage()->_('ErrorInvalidPasswords');
         } else {
             if ($form->validate()) {
                 $form->save();
                 System::getUser()->save();
                 System::getSession()->setData('successMsg', System::getLanguage()->_('ProfileUpdated'));
                 System::forwardToRoute(Router::getInstance()->build('ProfileController', 'index'));
                 exit;
             }
         }
     } else {
         $form->fill();
     }
     $form->setSubmit(new Button(System::getLanguage()->_('Save'), 'floppy-disk'));
     $smarty = new Template();
     $smarty->assign('title', System::getLanguage()->_('MyProfile'));
     $smarty->assign('heading', System::getLanguage()->_('MyProfile'));
     $smarty->assign('form', $form->__toString());
     $smarty->display('form.tpl');
 }
开发者ID:nicefirework,项目名称:sharecloud,代码行数:58,代码来源:ProfileController.class.php

示例8: index

function index()
{
    global $site_path, $db, $prefix, $site_host, $config, $lang;
    include "header.php";
    $id = intval($_GET["id"]);
    $tpl = new Template();
    $tpl->modTemplate("package");
    $result = $db->query("SELECT * FROM travel_package WHERE package_id={$id} AND package_active=1");
    $row = $db->fetch_array($result);
    $content = explode("<break>", "{$row['package_desc']}");
    $num_record = count($content);
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 1;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=package&file=packagedetails&id={$id}", $page, $pages);
    } else {
        $page_link = "";
    }
    $arrayelement = (int) $page;
    $arrayelement--;
    if (is_admin()) {
        $link = "<a href=index.php?file=admin&op=editpackage&id={$row['package_id']}>Edit</a>";
    } else {
        $link = "";
    }
    $contentx = nl2br($content[$arrayelement]);
    $q = $_SERVER["QUERY_STRING"];
    $url = "{$config['site_url']}/index.php?{$q}";
    $tpl->assign("phone", $config[site_phone]);
    $tpl->assign("lang", $lang);
    $tpl->assign("id", $id);
    $tpl->assign("link", $url);
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $num_record);
    $tpl->assign("currentpage", $currentpage);
    $tpl->assign("package", $row);
    $tpl->assign("content", $contentx);
    $tpl->display("package_details.tpl");
    include "footer.php";
}
开发者ID:bogiesoft,项目名称:TravelAgentv2,代码行数:55,代码来源:packagedetails.php

示例9: render

 public function render($template, $_vars = array(), $fetch = false)
 {
     $tpl = new Template($template);
     $this->addVars($_vars);
     foreach ($this->vars as $key => $var) {
         $tpl->assign($key, $var);
     }
     if ($fetch === true) {
         return $tpl->fetch($tpl->getTemplate());
     }
     $tpl->display($tpl->getTemplate());
     return true;
 }
开发者ID:erichub,项目名称:Presence-V-0.1,代码行数:13,代码来源:Response.class.php

示例10: defaultRender

 protected function defaultRender($responseObject)
 {
     $ref = new \ReflectionClass(get_class($responseObject));
     $path = str_replace('.php', '/' . $this->request->getResponseMethod() . '.php', $ref->getFileName());
     if (file_exists($path)) {
         $content = new Template($path, $responseObject);
         $layout = new Template($this->layout ?: $this->getDefaultLayout());
         $layout->content = $content;
         $layout->display();
         return true;
     }
     return false;
 }
开发者ID:ata,项目名称:simpleblog,代码行数:13,代码来源:Application.php

示例11: render

 public function render($tpl, array $vars = array(), $folder = '')
 {
     if (empty($folder)) {
         $folder = $this->folder_tpl;
         if (!empty($folder)) {
             $folder = explode('\\', $folder);
             $folder = end($folder);
             $folder = str_replace('Controller', '', $folder);
             $folder = strtolower($folder);
         }
     }
     $smarty = new Template($this->path_tpl, $folder);
     foreach ($vars as $key => $value) {
         $smarty->assign($key, $value);
     }
     $smarty->display($tpl . '.tpl');
 }
开发者ID:Garcy111,项目名称:Garcy-Framework-2,代码行数:17,代码来源:Controller.php

示例12: display

 /**
  * The display method that including caching.
  *
  * @return string
  * @author Justin Palmer
  **/
 public function display()
 {
     //var_dump($this->Controller);
     //If the cache type is null just return the template.
     //Or, if the cache_type is not one of the supported cache_types
     if ($this->view_path === null || !$this->Controller->pr_do_cache || !$this->isValidCacheType()) {
         return parent::display();
     }
     //If it is a valid cache type then call the method and return the template view.
     $cached = $this->Cache->isCached();
     if ($cached !== false) {
         return $this->Cache->get();
     } else {
         $content = parent::display();
         $this->Cache->value = $content;
         $this->Cache->cache();
         return $content;
     }
 }
开发者ID:ToddBudde,项目名称:phrails,代码行数:25,代码来源:TemplateCache.php

示例13: php

 public function php()
 {
     parent::checkAuthentification();
     parent::checkIfAdmin();
     $entries = LogEntry::find('log', 'php');
     if ($entries == NULL) {
         $entries = array();
     } else {
         if ($entries instanceof LogEntry) {
             $entries = array($entries);
         }
     }
     usort($entries, array('LogEntry', 'compare'));
     $smarty = new Template();
     $smarty->assign('entries', $entries);
     $smarty->assign('title', System::getLanguage()->_('Log'));
     $smarty->assign('heading', System::getLanguage()->_('PHPEntries'));
     $smarty->assign('showPHPEntries', true);
     $smarty->display('log/log.tpl');
 }
开发者ID:nicefirework,项目名称:sharecloud,代码行数:20,代码来源:LogController.class.php

示例14: get_list

 function get_list()
 {
     $allow_all = $GLOBALS["sclient"]->call('show_all', array('module' => $this->module));
     if ($allow_all != 'true') {
         $onlymine = "true";
     }
     $params = array(array('id' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']));
     $result = $GLOBALS["sclient"]->call('get_KBase_details', $params);
     $data['faqcategories'] = array();
     $data['faqcategories'] = $result[0];
     $data['faqproducts'] = $result[1];
     $data['faqs'] = $result[2];
     $faqspercat = array();
     if (isset($data['faqs']) && count($data['faqs']) > 0 && $data['faqs'] != "") {
         foreach ($data['faqs'] as $faq) {
             if (!isset($faqspercat[$faq["category"]])) {
                 $faqspercat[$faq["category"]] = array();
             }
             $params = array('id' => $faq["id"], 'module' => "Documents", 'contactid' => $_SESSION["loggeduser"]['id'], 'sessionid' => $_SESSION["loggeduser"]['sessionid']);
             $resultb = $GLOBALS["sclient"]->call('get_documents', $params);
             if (isset($resultb) && count($resultb) > 0 && $resultb != "") {
                 foreach ($resultb[1]['Documents']['data'] as $doc) {
                     $faq["attachments"][] = $doc;
                 }
             }
             $faqspercat[$faq["category"]][] = $faq;
         }
     }
     $faqpr = array();
     if (isset($data['faqproducts']) && count($data['faqproducts']) > 0 && $data['faqproducts'] != "") {
         foreach ($data['faqproducts'] as $faqprod) {
             if (!isset($faqpr[$faqprod["productid"]])) {
                 $faqpr[$faqprod["productid"]] = array();
             }
             $faqpr[$faqprod["productid"]] = $faqprod;
         }
     }
     $data['faqs'] = $faqspercat;
     $data['faqproducts'] = $faqpr;
     Template::display($this->module, $data, 'list');
 }
开发者ID:tsolucio,项目名称:coreBOSMYCCP,代码行数:41,代码来源:index.php

示例15: error

 /**
  * Send formatted error data
  */
 public function error()
 {
     $error = $this->out;
     // send HTTP header
     if (!headers_sent()) {
         header($_SERVER['SERVER_PROTOCOL'] . ' ' . $error->getCode());
         header('Content-Type: text/html');
     }
     // display error
     $template = new Template(Configuration::get('base_dir') . DS . 'templates' . DS . 'base.html');
     $template->replace('base_url', Configuration::get('base_url'));
     // make title
     $title = $error->getCode() . ' Error';
     $template->replace('title', $title);
     // make body
     $body = '<p><i>Message</i>: ' . $error->getMessage() . '</p>';
     $body .= '<p><i>Code</i>: ' . $error->getCode() . '</p>';
     $template->replace('content', $body);
     // display
     $template->display();
 }
开发者ID:amad4biz,项目名称:invoices,代码行数:24,代码来源:InvoiceHtml.php


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