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


PHP HTML_Template_IT::loadTemplatefile方法代码示例

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


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

示例1: buildMenuElement

 /**
  * This function creates a HTML-block for a menu item.
  *
  * @access public
  * @author arnold:tserepov <tserepov@gmail.com>
  * @param MenuElement $parameters['menuElement']
  *        	the menu element
  * @param string $parameters['type']
  *        	the type
  * @see MenuElement::$type
  * @uses MENU_COMMON for the common menu
  * @uses MENU_OUTER for the menu of outer links
  * @uses MENU_INNER for the menu of inner links
  */
 public static function buildMenuElement($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'tutshtml');
     $tpl->loadTemplatefile('burnstudio2-template.html');
     switch ($parameters['type']) {
         case MENU_COMMON:
             $tpl->setCurrentBlock('menu-item');
             $tpl->setVariable(array('HREF' => null === $parameters['menuElement']->getHref() ? $parameters['menuElement']->translate(array('property' => 'href', 'isSlug' => true)) : $parameters['menuElement']->getHref(), 'LABEL' => $parameters['menuElement']->translate(array('property' => 'label'))));
             $tpl->parse('menu-item');
             // echo ' 38: ', $tpl->get('menu-item');
             return $tpl->get('menu-item');
             break;
         case MENU_OUTER:
             $tpl->setCurrentBlock('outer-link');
             $tpl->setVariable(array('HREF-OF-OUTER-LINK' => null === $parameters['menuElement']->getHref() ? $parameters['menuElement']->translate(array('property' => 'href', 'isSlug' => true)) : $parameters['menuElement']->getHref(), 'LABEL-OF-OUTER-LINK' => $parameters['menuElement']->translate(array('property' => 'label'))));
             $tpl->parse('outer-link');
             return $tpl->get('outer-link');
             break;
         case MENU_INNER:
             $parameters['menuElement']->setAttributes();
             if ($parameters['menuElement']->isActive()) {
                 $tpl->touchBlock('current');
             }
             $tpl->setCurrentBlock('inner-link');
             $tpl->setVariable(array('HREF-OF-INNER-LINK' => '' === $parameters['menuElement']->getHref() ? $parameters['menuElement']->translate(array('property' => 'href', 'isSlug' => true)) : $parameters['menuElement']->getHref(), 'LABEL-OF-INNER-LINK' => $parameters['menuElement']->translate(array('property' => 'label'))));
             $tpl->parse('inner-link');
             return $tpl->get('inner-link');
             break;
         default:
             exit("What type?");
     }
 }
开发者ID:piiskop,项目名称:pstk,代码行数:47,代码来源:MenuElementView.php

示例2: showLoginForm

function showLoginForm(&$liveUserObj)
{
    $tpl = new HTML_Template_IT();
    $tpl->loadTemplatefile('loginform.tpl.php');
    $tpl->setVariable('form_action', $_SERVER['SCRIPT_NAME']);
    if (is_object($liveUserObj)) {
        if ($liveUserObj->getStatus()) {
            switch ($liveUserObj->getStatus()) {
                case LIVEUSER_STATUS_ISINACTIVE:
                    $tpl->touchBlock('inactive');
                    break;
                case LIVEUSER_STATUS_IDLED:
                    $tpl->touchBlock('idled');
                    break;
                case LIVEUSER_STATUS_EXPIRED:
                    $tpl->touchBlock('expired');
                    break;
                default:
                    $tpl->touchBlock('failure');
                    break;
            }
        }
    }
    $tpl->show();
    exit;
}
开发者ID:laiello,项目名称:coopcrucial,代码行数:26,代码来源:conf.php

示例3: send_confirmation

function send_confirmation($user_name, $email)
{
    // Create a new template, and specify that the template files are
    // in the same directory as the as the php files.
    $template = new HTML_Template_IT("./templates");
    // Load the email template file
    $template->loadTemplatefile("confirmemail.tpl", true, true);
    $template->setVariable("USERNAME", $user_name);
    $template->setVariable("EMAIL", $email);
    $to = $email;
    // Setup the headers.
    $headers["From"] = "noreply@vanhlebarsoftware.com";
    $headers["Subject"] = "Fitness Log Confirmation Email";
    $headers["X-Sender"] = "noreply@vanhlebarsoftware.com";
    $headers["X-Mailer"] = "PHP";
    $headers["Return-Path"] = "noreply@vanhlebarsoftware.com";
    $headers["To"] = $email;
    $body = $template->get();
    $host = "mail.vanhlebarsoftware.com";
    $mail_user = "noreply@vanhlebarsoftware.com";
    $password = "Tanis*1973";
    $smtp = Mail::factory('smtp', array('host' => $host, 'auth' => true, 'username' => $mail_user, 'password' => $password));
    $mail = $smtp->send($to, $headers, $body);
    if (PEAR::isError($mail)) {
        echo "<p>" . $mail->getMessage() . "</p>";
    }
}
开发者ID:EABonney,项目名称:Fitlog,代码行数:27,代码来源:createaccount.php

示例4: buildMenuElement

 /**
  * This function creates a HTML-block for a menu item.
  *
  * @access public
  * @param MenuElement $parameters['menuElement']
  *        	the menu element
  */
 public static function buildMenuElement($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html');
     $tpl->loadTemplatefile('from-design-to-web-template.html');
     switch ($parameters['type']) {
         case MENU_COMMON:
             $tpl->setCurrentBlock('menu-item');
             $tpl->setVariable(array('HREF' => $parameters['menuElement']->getHref(), 'LABEL' => $parameters['menuElement']->getLabel()));
             $tpl->parse('menu-item');
             return $tpl->get('menu-item');
             break;
             // /
         // /
         case MENU_OUTER:
             $tpl->setCurrentBlock('outer-link');
             $tpl->setVariable(array('HREF' => $parameters['menuElement']->getHref(), 'LABEL' => $parameters['menuElement']->getLabel()));
             $tpl->parse('outer-link');
             return $tpl->get('outer-link');
             break;
             // /
         // /
         case MENU_INNER:
             $tpl->setCurrentBlock('inner-link');
             $tpl->setVariable(array('HREF' => $parameters['menuElement']->getHref(), 'LABEL' => $parameters['menuElement']->getLabel()));
             $tpl->parse('inner-link');
             return $tpl->get('inner-link');
             break;
         default:
             exit("What type?");
     }
 }
开发者ID:piiskop,项目名称:pstk,代码行数:39,代码来源:MenuElementView.php

示例5: buildMenuElement

 /**
  * This function creates a HTML-block for a menu item.
  *
  * @access public
  * @author k
  * @param MenuElement $parameters['menuElement']
  *        	the menu element
  * @param string $parameters['type']
  *        	the type
  * @see MenuElement::$type
  * @uses Error for error handling
  * @uses ErrorView for error handling
  * @uses MENU_COMMON for the common menu
  * @uses MENU_SIDE for the menu in sidebar
  */
 public static function buildMenuElement($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html');
     $tpl->loadTemplatefile('particle-template.html');
     switch ($parameters['type']) {
         case MENU_COMMON:
             $tpl->setCurrentBlock('item-in-common-menu');
             $tpl->setVariable(array('HREF-OF-ITEM-IN-COMMON-MENU' => null === $parameters['menuElement']->getHref() ? $parameters['menuElement']->translate(array('property' => 'href', 'isSlug' => true)) : $parameters['menuElement']->getHref(), 'LABEL-OF-ITEM-IN-COMMON-MENU' => $parameters['menuElement']->translate(array('property' => 'label'))));
             $tpl->parse('item-in-common-menu');
             // echo ' 38: ', $tpl->get('menu-item');
             return $tpl->get('item-in-common-menu');
             break;
         case MENU_SIDE:
             $tpl->setCurrentBlock('item-in-menu-in-sidebar');
             $tpl->setVariable(array('HREF-OF-ITEM-IN-MENU-IN-SIDEBAR' => null === $parameters['menuElement']->getHref() ? $parameters['menuElement']->translate(array('property' => 'href', 'isSlug' => true)) : $parameters['menuElement']->getHref(), 'LABEL-OF-ITEM-IN-MENU-IN-SIDEBAR' => $parameters['menuElement']->translate(array('property' => 'label'))));
             $tpl->parse('item-in-menu-in-sidebar');
             return $tpl->get('item-in-menu-in-sidebar');
             break;
         default:
             require_once dirname(__FILE__) . '/Error.php';
             $error = new Error();
             $error->setMessage(\pstk\String::translate('errorWhichMenu'));
             require_once dirname(__FILE__) . '/ErrorView.php';
             ErrorView::raiseError($error);
     }
 }
开发者ID:piiskop,项目名称:pstk,代码行数:42,代码来源:MenuElementView.php

示例6: showLoginForm

function showLoginForm($liveUserObj = false)
{
    include_once 'HTML/Template/IT.php';
    $tpl = new HTML_Template_IT();
    $tpl->loadTemplatefile('loginform.tpl.php');
    $tpl->setVariable('form_action', $_SERVER['PHP_SELF']);
    if (is_object($liveUserObj)) {
        if ($liveUserObj->status) {
            switch ($liveUserObj->status) {
                case LIVEUSER_STATUS_ISINACTIVE:
                    $tpl->touchBlock('inactive');
                    break;
                case LIVEUSER_STATUS_IDLED:
                    $tpl->touchBlock('idled');
                    break;
                case LIVEUSER_STATUS_EXPIRED:
                    $tpl->touchBlock('expired');
                    break;
                default:
                    $tpl->touchBlock('failure');
                    break;
            }
        }
    }
    $tpl->show();
    exit;
}
开发者ID:BackupTheBerlios,项目名称:hem,代码行数:27,代码来源:conf.php

示例7: parseFooter

function parseFooter()
{
    global $_PATHS;
    $objTpl = new HTML_Template_IT($_PATHS['templates']);
    $objTpl->loadTemplatefile("footer.tpl.htm", false, false);
    return $objTpl->get();
}
开发者ID:laiello,项目名称:punchcms,代码行数:7,代码来源:inc.tplparse_foot.php

示例8: buildView

 /**
  * This function builds the main structure in HTML.
  *
  * @access public
  * @author kalmer:piiskop <pandeero@gmail.com>
  * @param string $parameters['address']
  *        	the address
  * @param string $parameters['blogDate']
  *        	the date of the blog
  * @param string $parameters['blogEntry']
  *        	the blog entry
  * @param Human $parameters['designer']
  *        	the designer
  * @param string $parameters['menu']
  *        	the body
  * @param string $parameters['phoneNumber']
  *        	the phone number
  * @param string $parameters['title']
  *        	the title
  * @param string $parameters['twitter']
  *        	the Twitter-time
  * @return string the parsed HTML-structure
  * @uses BEGINNING_OF_URL for links
  * @uses \pstk\ErrorView for displaying error messages
  * @uses MENU_COMMON for the common menu
  * @uses MENU_SIDE for the menu in sidebar
  */
 public static function buildView($parameters)
 {
     require_once 'HTML/Template/IT.php';
     require_once dirname(__FILE__) . '/../php/ErrorView.php';
     \PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(new \pstk\ErrorView(), 'raiseError'));
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html');
     $tpl->loadTemplatefile('particle-template.html');
     if (isset($parameters['menus'])) {
         if (isset($parameters['menus'][MENU_COMMON])) {
             $tpl->setCurrentBlock('common-menu');
             $tpl->setVariable(array('COMMON-MENU' => $parameters['menus'][MENU_COMMON]));
             $tpl->parse('common-menu');
         }
         if (isset($parameters['menus'][MENU_SIDE])) {
             $tpl->setCurrentBlock('menu-in-sidebar');
             $tpl->setVariable(array('MENU-IN-SIDEBAR' => $parameters['menus'][MENU_SIDE]));
             $tpl->parse('menu-in-sidebar');
         }
     }
     if (isset($parameters['posts'])) {
         $tpl->setCurrentBlock('posts');
         $tpl->setVariable(array('POSTS' => $parameters['posts']));
         $tpl->parse('posts');
     }
     require_once dirname(__FILE__) . '/Model.php';
     $model = new Model();
     $model->setComplete();
     require_once dirname(__FILE__) . '/../php/CssView.php';
     $tpl->setCurrentBlock('html');
     $tpl->setVariable(array('ACTION' => '', 'BEGINNING-OF-URL' => BEGINNING_OF_URL, 'FOLLOW-ME' => $model->translate(array('property' => 'followMe')), 'HEADING' => $parameters['title'], 'OLDER-POSTS' => $model->translate(array('property' => 'olderPosts')), 'NEWER-POSTS' => $model->translate(array('property' => 'newerPosts')), 'SEARCH' => \pstk\String::translate('search'), 'SUBSCRIBE' => $model->translate(array('property' => 'subscribe')), 'STYLE' => \pstk\CssView::buildCss(array('fileName' => 'particle-template')), 'TITLE' => mb_strtoupper($parameters['title'], 'UTF-8')));
     $tpl->parse('html');
     return $tpl->get('html');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:60,代码来源:View.php

示例9: buildPersonView

 function buildPersonView($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(dirname(__FILE__) . '/');
     $tpl->loadTemplatefile('persons.html');
     $tpl->parse('persons');
     return $tpl->get('persons');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:8,代码来源:PersonView.php

示例10: buildHeader

 /**
  * This function builds the header.
  * 
  * @access public
  * @author kalmer
  * @return string
  */
 public static function buildHeader()
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(dirname(__FILE__) . '/../html');
     $tpl->loadTemplatefile('header.html');
     $tpl->touchBlock('header');
     $tpl->parse('header');
     return $tpl->get('header');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:16,代码来源:HeaderView.php

示例11: parsePage

function parsePage($intElmntId, $strCommand)
{
    global $_PATHS, $_CONF, $objLang, $objLiveAdmin;
    $objTpl = new HTML_Template_IT($_PATHS['templates']);
    $objTpl->loadTemplatefile("noaccount.tpl.htm");
    $objTpl->setVariable("CLIENT_NAME", $objLang->get("invalidAccount", "login"));
    $objTpl->setVariable("POWERED_BY", $objLang->get("poweredBy", "label"));
    $objTpl->setVariable("MESSAGE", $objLang->get("noAccount", "alert"));
    return $objTpl->get();
}
开发者ID:laiello,项目名称:punchcms,代码行数:10,代码来源:inc.tplparse_noaccount.php

示例12: buildPage

 /**
  * this function builds the page
  *
  * @access public
  * @author tambet
  * @param string $prameters['title']
  *        	shows-title
  * @param string $prameters['body']
  *        	shows-body
  */
 public static function buildPage($prameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(dirname(__FILE__) . '/');
     $tpl->loadTemplatefile('page.html');
     $tpl->setCurrentBlock('page');
     $tpl->setVariable(array('TITLE' => $prameters['title'], 'BODY' => $prameters['body']));
     $tpl->parse('page');
     return $tpl->get('page');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:20,代码来源:PageView.php

示例13: buildCss

 /**
  * This function builds the CSS-part.
  *
  * @access public
  * @author kalmer:piiskop <pandeero@gmail.com>
  * @param string $parameters['fileName'] the name of the CSS-file
  * @return string the CSS-part
  * @uses BEGINNING_OF_URL for image paths
  * @uses ROOT_FOLDER for the path to the CSS-template folder
  */
 public static function buildCss($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'css');
     $tpl->loadTemplatefile($parameters['fileName'] . '.css');
     $tpl->setCurrentBlock('css');
     $tpl->setVariable(array('BEGINNING-OF-URL' => BEGINNING_OF_URL));
     $tpl->parse('css');
     return $tpl->get('css');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:20,代码来源:CssView.php

示例14: buildLogo

 /**
  * This function creates a HTML-block for a logo.
  *
  * @access public
  * @param Logo $parameters['logo']
  *        	the logo
  * @uses BEGINNING_OF_URL the beginning of the URL
  */
 public static function buildLogo($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html');
     $tpl->loadTemplatefile('psdtohtml-template.html');
     $tpl->setCurrentBlock('logo');
     $tpl->setVariable(array('ALT-OF-LOGO' => $parameters['logo']->getAlt(), 'BEGINNING-OF-URL' => BEGINNING_OF_URL, 'SRC-OF-LOGO' => $parameters['logo']->getSrc(), 'SIZES-OF-LOGO' => $parameters['logo']->getSizes()));
     $tpl->parse('logo');
     return $tpl->get('logo');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:18,代码来源:LogoView.php

示例15: buildMenuView

 public static function buildMenuView($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT("./html");
     $tpl->loadTemplatefile('burnstudio-copy.html');
     $tpl->setCurrentBlock('menu-item');
     $tpl->setVariable(array('HREF' => $parameters[0]['object']->getHref(), 'LABEL' => $parameters[0]['object']->getLabel()));
     $tpl->parse('menu-item');
     return $tpl->get('menu-item');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:10,代码来源:MenuView.php


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