当前位置: 首页>>代码示例>>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;未经允许,请勿转载。