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


PHP Smarty_Internal_Template::display方法代碼示例

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


在下文中一共展示了Smarty_Internal_Template::display方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: smarty_block_tip

/**
 * Display a tip block
 *
 * @package application.helper.smarty
 * @author Integry Systems
 *
 * @package application.helper.smarty
 */
function smarty_block_tip($params, $content, Smarty_Internal_Template $smarty, &$repeat)
{
    if (!$repeat) {
        $smarty->assign('tipContent', $content);
        return $smarty->display('block/backend/tip.tpl');
    }
}
開發者ID:saiber,項目名稱:livecart,代碼行數:15,代碼來源:block.tip.php

示例2: smarty_function_backendLangMenu

/**
 * Displays backend language selection menu
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 *
 * @package application.helper.smarty
 * @author Integry Systems
 */
function smarty_function_backendLangMenu($params, Smarty_Internal_Template $smarty)
{
    if (!$smarty->getApplication()->getLanguageArray()) {
        return false;
    }
    $smarty->assign('currentLang', Language::getInstanceByID($smarty->getApplication()->getLocaleCode())->toArray());
    $smarty->assign('returnRoute', base64_encode($smarty->getApplication()->getRouter()->getRequestedRoute()));
    return $smarty->display('block/backend/langMenu.tpl');
}
開發者ID:saiber,項目名稱:livecart,代碼行數:19,代碼來源:function.backendLangMenu.php

示例3: smarty_function_activeGrid

/**
 * Displays ActiveGrid table
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 *
 * @package application.helper.smarty
 * @author Integry Systems
 */
function smarty_function_activeGrid($params, Smarty_Internal_Template $smarty)
{
    if (!isset($params['rowCount']) || !$params['rowCount']) {
        $params['rowCount'] = 15;
    }
    foreach ($params as $key => $value) {
        $smarty->assign($key, $value);
    }
    if (isset($params['filters']) && is_array($params['filters'])) {
        $smarty->assign('filters', $params['filters']);
    }
    $smarty->assign('url', $smarty->getApplication()->getRouter()->createUrl(array('controller' => $params['controller'], 'action' => $params['action']), true));
    $smarty->assign('thisMonth', date('m'));
    $smarty->assign('lastMonth', date('Y-m', strtotime(date('m') . '/15 -1 month')));
    return $smarty->display('block/activeGrid/gridTable.tpl');
}
開發者ID:saiber,項目名稱:livecart,代碼行數:26,代碼來源:function.activeGrid.php

示例4: accordion

 public static function accordion($params, Smarty_Internal_Template &$smarty)
 {
     $smarty->assign('accordion_params', $params);
     $smarty->display('accordion.tpl');
 }
開發者ID:nicefirework,項目名稱:subrion,代碼行數:5,代碼來源:SmartyPlugins.class.php

示例5: smarty_function_ia_menu

function smarty_function_ia_menu($params, Smarty_Internal_Template &$smarty)
{
    if (!isset($params['menus']) || empty($params['menus'])) {
        return '';
    }
    $iaCore = iaCore::instance();
    if (isset($params['loginout']) && $params['loginout'] && $iaCore->get('members_enabled')) {
        $iaCore->factory('users');
        $menuDefaults = array('parent_id' => 0, 'el_id' => '0_000', 'menu' => 1, 'level' => 0, 'nofollow' => true);
        $currentPage = $iaCore->iaView->name();
        if (iaUsers::hasIdentity()) {
            $params['menus'][0][] = array_merge($menuDefaults, array('id' => -1, 'page_name' => 'logout', 'new_window' => 0, 'text' => iaLanguage::get('logout'), 'url' => 'logout/', 'active' => 'logout' == $currentPage));
        } else {
            $params['menus'][0][] = array_merge($menuDefaults, array('id' => -1, 'page_name' => 'login', 'new_window' => 0, 'text' => iaLanguage::get('page_title_login'), 'url' => 'login/', 'active' => 'login' == $currentPage));
            $params['menus'][0][] = array_merge($menuDefaults, array('id' => 0, 'page_name' => 'member_registration', 'new_window' => 0, 'text' => iaLanguage::get('page_title_member_registration'), 'url' => 'registration/', 'active' => 'member_registration' == $currentPage));
        }
    }
    $level = isset($params['level']) ? (int) $params['level'] : false;
    $tpl = isset($params['tpl']) ? $params['tpl'] : 'ul';
    $classname = isset($params['class']) ? $params['class'] : 'level';
    $textAfter = isset($params['after']) ? $params['after'] : '';
    $textBefore = isset($params['before']) ? $params['before'] : '';
    // TODO: add menus only of particular level
    if ($level !== false) {
        $alreadyShown = false;
        $list = array();
        $menus = $params['menus'];
        foreach ($menus as $pid => $children) {
            $check = false;
            foreach ($children as $child) {
                if ($child['level'] == $level) {
                    $check = true;
                    break;
                }
            }
            if ($check) {
                $hide = $iaCore->iaView->get('id') == $pid ? true : false;
                $list[$pid] = array('children' => $children, 'hide' => $hide);
                if ($hide === false) {
                    $alreadyShown = true;
                }
            }
        }
        unset($menus);
        echo $textBefore;
        foreach ($list as $pid => $item) {
            if ($alreadyShown === false) {
                $item['hide'] = false;
                $alreadyShown = true;
            }
            $smarty->assign('text_before', '');
            $smarty->assign('text_after', '');
            $smarty->assign('menu_children', true);
            $smarty->assign('menus', array($pid => $item['children']));
            $smarty->assign('menu_class', $classname);
            $smarty->display('menu-' . $tpl . '.tpl', $tpl . mt_rand(1000, 9999));
        }
        echo $textAfter;
    } else {
        $smarty->assign('text_before', $textBefore);
        $smarty->assign('text_after', $textAfter);
        $smarty->assign('menus', $params['menus']);
        $smarty->assign('menu_class', $classname);
        $smarty->display('menu-' . $tpl . '.tpl', $tpl . mt_rand(1000, 9999));
    }
}
開發者ID:kamilklkn,項目名稱:subrion,代碼行數:66,代碼來源:function.ia_menu.php


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