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


PHP HTML_Template_IT::setVariable方法代碼示例

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


在下文中一共展示了HTML_Template_IT::setVariable方法的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: parseAnnouncment

function parseAnnouncment()
{
    global $_PATHS, $objLang;
    $objTpl = new HTML_Template_IT($_PATHS['templates']);
    $objTpl->loadTemplatefile("announcement.tpl.htm");
    $objTpl->setVariable("BUTTON_CLOSE", $objLang->get("close", "button"));
    $objMessages = AnnounceMessage::getMessages();
    foreach ($objMessages as $objMessage) {
        $objTpl->setVariable("HEADER", $objMessage->getHeader());
        $objTpl->setVariable("BODY", $objMessage->getMessage());
        break;
    }
    return $objTpl->get();
}
開發者ID:laiello,項目名稱:punchcms,代碼行數:14,代碼來源:inc.tplparse_announcments.php

示例8: buildListOfItems

 public function buildListOfItems($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(ROOT_FOLDER . "html");
     $tpl->loadTemplatefile('items.html');
     foreach ($parameters['items'] as $id => $item) {
         $tpl->setCurrentBlock('item');
         $tpl->setVariable(array('NAME' => $item['title']));
         $tpl->parse('item');
     }
     $tpl->setCurrentBlock('body');
     $tpl->setVariable(array('TITLE' => 'Tooted'));
     $tpl->parse('body');
     return $tpl->get('body');
 }
開發者ID:piiskop,項目名稱:pstk,代碼行數:15,代碼來源:ItemView.php

示例9: buildListOfOrderPersons

 /**
  * This function builds the list of order persons.
  *
  * @access public
  * @param mixed $parameters['orderPersons']
  *        	the list of order persons according to the result of
  *        	<code>getListOfType</code>...-method
  * @return the parsed HTML-file
  */
 public static function buildListOfOrderPersons($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT("./html");
     $tpl->loadTemplatefile('order-persons.html');
     foreach ($parameters['orderPersons'] as $idOrderPerson => $orderPerson) {
         $tpl->setCurrentBlock('order-person');
         $tpl->setVariable(array('NAME' => $orderPerson['title']));
         $tpl->parse('order-person');
     }
     $tpl->setCurrentBlock('html');
     $tpl->setVariable(array('TITLE' => 'Kliendid'));
     $tpl->parse('html');
     return $tpl->get('html');
 }
開發者ID:piiskop,項目名稱:pstk,代碼行數:24,代碼來源:OrderPersonView.php

示例10: buildListOfShipTo

 /**
  * This function builds the list of shipping locations.
  */
 public static function buildListOfShipTo($parameters)
 {
     require_once 'HTML/Template/IT.php';
     //$tpl = new \HTML_Template_IT(ROOT_FOLDER . 'html');
     $tpl = new \HTML_Template_IT("../html");
     $tpl->loadTemplatefile('ShipTo.html');
     foreach ($parameters['ShipTo'] as $idShipTo => $ShipTo) {
         $tpl->setCurrentBlock('ship-to');
         $tpl->setVariable(array('NAME' => $ShipTo['title']));
         $tpl->parse('ship-to');
     }
     $tpl->setCurrentBlock('html');
     $tpl->setVariable(array('TITLE' => 'Sihtkoht'));
     $tpl->parse('html');
     return $tpl->get('html');
 }
開發者ID:piiskop,項目名稱:pstk,代碼行數:19,代碼來源:ShipToView.php

示例11: buildListOfShipTos

 /**
  * This function builds the list of shipping
  *
  * @access public
  * @param mixed $parameters['shipTos']
  *        	the list of shipping according to the result of
  *        	<code>getListOfType</code>...-method
  * @return the parsed HTML-file
  */
 public static function buildListOfShipTos($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT("./html");
     $tpl->loadTemplatefile('ship-tos.html');
     foreach ($parameters['shipTos'] as $idShipTo => $shipTo) {
         $tpl->setCurrentBlock('ships-to');
         $tpl->setVariable(array('NAME' => $shipTo['title']));
         $tpl->setVariable(array('ADDRESS' => $shipTo['title2']));
         $tpl->parse('ships-to');
     }
     $tpl->setCurrentBlock('html');
     $tpl->setVariable(array('TITLE' => 'Toote saatmisinfo'));
     $tpl->parse('html');
     return $tpl->get('html');
 }
開發者ID:piiskop,項目名稱:pstk,代碼行數:25,代碼來源:ShipToView.php

示例12: 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

示例13: 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

示例14: buildFormOfValjatostmine

 /**
  * Ehitab ülesse lehe vaate
  * @param boolean $parameters['build_result'] Kas näitame tulemust?
  * @param string $parameters['result'] tulemuse text
  * @param Owner $parameters['owner'] omanik
  */
 public static function buildFormOfValjatostmine($parameters)
 {
     require_once 'HTML/Template/IT.php';
     $tpl = new \HTML_Template_IT(dirname(__FILE__));
     $tpl->loadTemplatefile('index.html');
     if ($parameters['build_result']) {
         $tpl->setCurrentBlock('result');
         $tpl->setVariable(array('RESULT' => $parameters['result']));
         $tpl->parse('result');
     }
     $tpl->setCurrentBlock('form');
     $tpl->setVariable(array('ISOWNERBRESENTCHECKT' => $parameters['owner']->getIsPresent() ? ' checked="checked"' : '', 'ISOWNERAGREETCHECKT' => $parameters['owner']->getAgrees() ? 'checked="checked"' : '', 'ISOWNERREACHABLECHECKT' => $parameters['owner']->getIsReachable() ? 'checked="checked"' : ''));
     $tpl->parse('form');
     $tpl->parse('page');
     return $tpl->get('page');
 }
開發者ID:piiskop,項目名稱:pstk,代碼行數:22,代碼來源:Valjatostmine.php

示例15: executeUpdateScript

function executeUpdateScript(HTML_Template_IT &$objTpl)
{
    if (!verifyVersion($GLOBALS["_CONF"]["app"]["version"])) {
        $objTpl->setCurrentBlock("update");
        $objTpl->setVariable("VERSION", $GLOBALS["_CONF"]["app"]["version"]);
        $objTpl->parseCurrentBlock();
    }
}
開發者ID:laiello,項目名稱:punchcms,代碼行數:8,代碼來源:inc.verify_version.php


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