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


PHP jTpl::display方法代码示例

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


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

示例1: output

 public function output()
 {
     if ($this->hasErrors()) {
         return false;
     }
     $this->_httpHeaders['Content-Type'] = 'text/xml;charset=' . $GLOBALS['gJConfig']->charset;
     $this->sendHttpHeaders();
     echo '<?xml version="1.0" encoding="' . $GLOBALS['gJConfig']->charset . '"?>';
     $this->prologSent = true;
     if ($this->template != '') {
         $tpl = new jTpl();
         $tpl->assign('data', $this->data);
         $tpl->display($this->template);
     } else {
         $this->generateContent();
     }
     return true;
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:18,代码来源:jResponseRdf.class.php

示例2: showMainTemplate

 protected function showMainTemplate($page, $content, $continue)
 {
     $filename = "wiz_layout.tpl";
     $path = $this->getRealPath('', $filename);
     jTplConfig::$templatePath = dirname($path) . '/';
     $this->loadLocales('', 'wiz_layout');
     $conf = $this->config[$this->stepName . '.step'];
     $tpl = new jTpl();
     $tpl->assign('title', $page->getLocale($page->title));
     if (isset($conf['messageHeader'])) {
         $tpl->assign('messageHeader', $conf['messageHeader']);
     } else {
         $tpl->assign('messageHeader', '');
     }
     if (isset($conf['messageFooter'])) {
         $tpl->assign('messageFooter', $conf['messageFooter']);
     } else {
         $tpl->assign('messageFooter', '');
     }
     $tpl->assign('MAIN', $content);
     $tpl->assign(array_merge(array('enctype' => ''), $conf));
     $tpl->assign('stepname', $this->stepName);
     $tpl->assign('lang', $this->lang);
     $tpl->assign('next', $continue && isset($conf['next']));
     $tpl->assign('previous', isset($conf['__previous']) ? $conf['__previous'] : '');
     $tpl->assign('appname', isset($this->config['appname']) ? $this->config['appname'] : 'Application');
     $tpl->display($filename, 'html');
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:28,代码来源:installWizard.php

示例3: dirname

<?php

error_reporting(E_ALL);
include '../jtpl_standalone_prepend.php';
jTplConfig::$cachePath = dirname(__FILE__) . '/../temp/';
jTplConfig::$templatePath = dirname(__FILE__) . '/';
$tpl = new jTpl();
$countries = array('France', 'Italie', 'Espagne', 'Belgique');
$tpl->assign('countries', $countries);
$tpl->assign('titre', 'This is a test !');
$tpl->display('test.tpl');
$tpl = new jTpl();
$tpl->assign('titre', 'This is an other test !');
$tpl->display('foo/test.tpl');
开发者ID:hadrienl,项目名称:jelix,代码行数:14,代码来源:exemple.php

示例4: output

 /**
  * generate the xul content.
  * @return boolean    true if it's ok
  */
 public function output()
 {
     $this->_headSent = false;
     $this->_httpHeaders['Content-Type'] = 'application/vnd.mozilla.xul+xml;charset=' . $GLOBALS['gJConfig']->charset;
     $this->sendHttpHeaders();
     $this->doAfterActions();
     if ($this->bodyTpl != '') {
         $this->body->meta($this->bodyTpl);
     }
     $this->outputHeader();
     $this->_headSent = true;
     echo implode('', $this->_bodyTop);
     if ($this->bodyTpl != '') {
         $this->body->display($this->bodyTpl);
     }
     if ($this->hasErrors()) {
         if ($GLOBALS['gJConfig']->error_handling['showInFirebug']) {
             echo '<script type="text/javascript">if(console){';
             foreach ($GLOBALS['gJCoord']->errorMessages as $e) {
                 switch ($e[0]) {
                     case 'warning':
                         echo 'console.warn("[warning ';
                         break;
                     case 'notice':
                         echo 'console.info("[notice ';
                         break;
                     case 'strict':
                         echo 'console.info("[strict ';
                         break;
                     case 'error':
                         echo 'console.error("[error ';
                         break;
                 }
                 echo $e[1], '] ', str_replace(array('"', "\n", "\r", "\t"), array('\\"', '\\n', '\\r', '\\t'), $e[2]), ' (', str_replace('\\', '\\\\', $e[3]), ' ', $e[4], ')");';
             }
             echo '}else{alert("there are some errors, you should activate Firebug to see them");}</script>';
         } else {
             echo '<vbox id="jelixerror" style="border:3px solid red; background-color:#f39999;color:black;">';
             echo $this->getFormatedErrorMsg();
             echo '</vbox>';
         }
     }
     echo implode('', $this->_bodyBottom);
     if (count($GLOBALS['gJCoord']->logMessages)) {
         if (count($GLOBALS['gJCoord']->logMessages['response'])) {
             echo '<vbox id="jelixlog">';
             foreach ($GLOBALS['gJCoord']->logMessages['response'] as $m) {
                 echo '<description>', htmlspecialchars($m), '</description>';
             }
             echo '</vbox>';
         }
         if (count($GLOBALS['gJCoord']->logMessages['firebug'])) {
             echo '<script type="text/javascript">if(console){';
             foreach ($GLOBALS['gJCoord']->logMessages['firebug'] as $m) {
                 echo 'console.debug("', str_replace(array('"', "\n", "\r", "\t"), array('\\"', '\\n', '\\r', '\\t'), $m), '");';
             }
             echo '}else{alert("there are log messages, you should activate Firebug to see them");}</script>';
         }
     }
     echo '</', $this->_root, '>';
     return true;
 }
开发者ID:Calmacil,项目名称:ffdvh,代码行数:66,代码来源:jResponseXul.class.php

示例5: output

 /**
  * output the html content
  *
  * @return boolean    true if the generated content is ok
  */
 public final function output()
 {
     $this->_headSent = 0;
     if ($this->_isXhtml && $this->xhtmlContentType && strstr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) {
         $this->_httpHeaders['Content-Type'] = 'application/xhtml+xml;charset=' . $this->_charset;
     } else {
         $this->_httpHeaders['Content-Type'] = 'text/html;charset=' . $this->_charset;
     }
     $this->sendHttpHeaders();
     $this->outputDoctype();
     $this->_headSent = 1;
     $this->doAfterActions();
     if ($this->bodyTpl != '') {
         $this->body->meta($this->bodyTpl);
     }
     $this->outputHtmlHeader();
     echo '<body ';
     foreach ($this->bodyTagAttributes as $attr => $value) {
         echo $attr, '="', htmlspecialchars($value), '" ';
     }
     echo ">\n";
     $this->_headSent = 2;
     echo implode("\n", $this->_bodyTop);
     if ($this->bodyTpl != '') {
         $this->body->display($this->bodyTpl);
     }
     if ($this->hasErrors()) {
         if ($GLOBALS['gJConfig']->error_handling['showInFirebug']) {
             echo '<script type="text/javascript">if(console){';
             foreach ($GLOBALS['gJCoord']->errorMessages as $e) {
                 switch ($e[0]) {
                     case 'warning':
                         echo 'console.warn("[warning ';
                         break;
                     case 'notice':
                         echo 'console.info("[notice ';
                         break;
                     case 'strict':
                         echo 'console.info("[strict ';
                         break;
                     case 'error':
                         echo 'console.error("[error ';
                         break;
                 }
                 echo $e[1], '] ', str_replace(array('"', "\n", "\r", "\t"), array('\\"', '\\n', '\\r', '\\t'), $e[2]), ' (', str_replace('\\', '\\\\', $e[3]), ' ', $e[4], ')");';
             }
             echo '}else{alert("there are some errors, you should activate Firebug to see them");}</script>';
         } else {
             echo '<div id="jelixerror" style="position:absolute;left:0px;top:0px;border:3px solid red; background-color:#f39999;color:black;">';
             echo $this->getFormatedErrorMsg();
             echo '<p><a href="#" onclick="document.getElementById(\'jelixerror\').style.display=\'none\';return false;">fermer</a></p></div>';
         }
     }
     echo implode("\n", $this->_bodyBottom);
     if (count($GLOBALS['gJCoord']->logMessages)) {
         if (count($GLOBALS['gJCoord']->logMessages['response'])) {
             echo '<ul id="jelixlog">';
             foreach ($GLOBALS['gJCoord']->logMessages['response'] as $m) {
                 echo '<li>', htmlspecialchars($m), '</li>';
             }
             echo '</ul>';
         }
         if (count($GLOBALS['gJCoord']->logMessages['firebug'])) {
             echo '<script type="text/javascript">if(console){';
             foreach ($GLOBALS['gJCoord']->logMessages['firebug'] as $m) {
                 echo 'console.debug("', str_replace(array('"', "\n", "\r", "\t"), array('\\"', '\\n', '\\r', '\\t'), $m), '");';
             }
             echo '}else{alert("there are log messages, you should activate Firebug to see them");}</script>';
         }
     }
     echo '</body></html>';
     return true;
 }
开发者ID:Calmacil,项目名称:ffdvh,代码行数:78,代码来源:jResponseHtml.class.php


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