本文整理汇总了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');
}
}
示例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');
}
示例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');
}
示例4: accordion
public static function accordion($params, Smarty_Internal_Template &$smarty)
{
$smarty->assign('accordion_params', $params);
$smarty->display('accordion.tpl');
}
示例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));
}
}