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


PHP Smarty::_smarty_include方法代码示例

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


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

示例1:

 function _smarty_include($params)
 {
     if (isset($params['smarty_include_tpl_file'])) {
         $params['smarty_include_tpl_file'] = Engine::getInstance()->Plugin_GetDelegate('template', $params['smarty_include_tpl_file']);
     }
     parent::_smarty_include($params);
 }
开发者ID:lifecom,项目名称:test,代码行数:7,代码来源:lsSmarty.class.php

示例2: substr

	function _smarty_include($params)
	{
		$theme_locations = Zend_Registry::get('theme_locations');
		if ($this->_tpl_vars['isAdminController'])
		{
			$theme_global = $theme_locations['admin']['current_theme']['path'];
			$default_global = $theme_locations['admin']['default_theme']['path'];
		}
		else
		{
			$theme_global = $theme_locations['frontend']['current_theme']['path'];
			$default_global = $theme_locations['frontend']['default_theme']['path'];
		}
		$file = substr( $params['smarty_include_tpl_file'], strlen("file:"));
		if (!file_exists($file))
		{
			$params['smarty_include_tpl_file'] = str_replace($theme_global, $default_global, $params['smarty_include_tpl_file']);
		}
		$file = substr( $params['smarty_include_tpl_file'], strlen("file:"));
		if (!file_exists($file))
		{
			throw new Exception("MISSING_TEMPLATE - The template file does not exist: " . $file);
		}
		return parent::_smarty_include($params);
	}
开发者ID:richjoslin,项目名称:rivety,代码行数:25,代码来源:Smarty.php

示例3: _smarty_include

 public function _smarty_include($params)
 {
     $info = pathinfo($params["smarty_include_tpl_file"]);
     if ($info['extension'] != 'tpl') {
         return;
     }
     parent::_smarty_include($params);
 }
开发者ID:evgeny-v-z,项目名称:framework,代码行数:8,代码来源:Templater.php

示例4: substr

 function _smarty_include($params)
 {
     global $language;
     $langfile = substr($_smarty_tpl_file, 0, -4) . '.' . $language . '.tpl';
     if (is_file($this->template_dir . "/" . $langfile)) {
         $params['smarty_include_tpl_file'] = $langfile;
     }
     return parent::_smarty_include($params);
 }
开发者ID:BackupTheBerlios,项目名称:localis,代码行数:9,代码来源:setup_smarty.php

示例5: elseif

 function _smarty_include($params)
 {
     global $style_base, $tikidomain;
     if (isset($style_base)) {
         if ($tikidomain and file_exists("templates/{$tikidomain}/styles/{$style_base}/" . $params['smarty_include_tpl_file'])) {
             $params['smarty_include_tpl_file'] = "{$tikidomain}/styles/{$style_base}/" . $params['smarty_include_tpl_file'];
         } elseif ($tikidomain and file_exists("templates/{$tikidomain}/" . $params['smarty_include_tpl_file'])) {
             $params['smarty_include_tpl_file'] = "{$tikidomain}/" . $params['smarty_include_tpl_file'];
         } elseif (file_exists("templates/styles/{$style_base}/" . $params['smarty_include_tpl_file'])) {
             $params['smarty_include_tpl_file'] = "styles/{$style_base}/" . $params['smarty_include_tpl_file'];
         }
     }
     return parent::_smarty_include($params);
 }
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:14,代码来源:setup_smarty.php

示例6: smarty_function_pagenavigator

/**
 * 处理分页导航模板
 * 
 * 输出的模板变量
 * $pagenav {array}
 * {{$pagenav.~}}
 * 
 * nums: {array} 页码列表
 * currpage: {int} 当前页面
 * recordcount: {int} 记录数
 * pagecount: {int} 总页数
 * query: {array} 页面传递参数
 * next: {int} 下一页的页码
 * prev: {int} 前一页页码
 * 
 * @param array $params
 *      currpage:当前分页
 *      recordcount: 记录总数
 *      pagecount: 分页总数
 *      template: 模板文件
 *      numcount: 分页数字的个数
 *      url: 跳转url
 *      query: 页面跳转传递的参数
 * @param Smarty $smarty
 * @return void
 */
function smarty_function_pagenavigator($params, &$smarty)
{
    if (empty($params['template'])) {
        $smarty->trigger_error('Undefined pagenavigator template file');
    }
    if (!isset($params['recordcount'])) {
        //$smarty->trigger_error('Undefined recordcount');
        return;
    }
    if (!isset($params['pagecount'])) {
        //$smarty->trigger_error('Undefined pagecount');
        return;
    }
    $currpage = max(1, (int) @$params['currpage']);
    $pagecount = (int) $params['pagecount'];
    $recordcount = (int) $params['recordcount'];
    $numcount = (int) @$params['numcount'];
    // 模板变量
    $tplvar = array('pagecount' => $pagecount, 'recordcount' => $recordcount, 'currpage' => $currpage, 'next' => $currpage < $pagecount ? $currpage + 1 : null, 'prev' => $currpage > 1 ? $currpage - 1 : null, 'url' => empty($params['url']) ? $_SERVER['SCRIPT_NAME'] : $params['url'], 'jsfunc' => @$params['jsfunc']);
    // 输出页码
    if ($numcount > 0) {
        $lbound = $currpage > intval($numcount / 2) ? $currpage - intval($numcount / 2) : 1;
        $ubound = $lbound + $numcount - 1 > $pagecount ? $pagecount : $lbound + $numcount - 1;
        $nums = array();
        for ($i = $lbound; $i <= $ubound; $i++) {
            $nums[] = $i;
        }
        $tplvar['nums'] = $nums;
    }
    if (!empty($params['query']) && is_array($params['query'])) {
        $tplvar['query'] = $params['query'];
    }
    $array = array('smarty_include_vars' => array('pagenav' => $tplvar), 'smarty_include_tpl_file' => $params['template']);
    $smarty->register_function('page_url', 'smarty_function_pagenavigator_buildurl');
    $smarty->register_function('page_jsfunc', 'smarty_function_pagenavigator_buildjsfunc');
    $smarty->_smarty_include($array);
}
开发者ID:bjtenao,项目名称:tudu-web,代码行数:63,代码来源:function.pagenavigator.php

示例7:

 /**
  * Override the Smarty {include ...} function to allow hooks to be
  * called.
  */
 function _smarty_include($params)
 {
     if (!HookRegistry::call('TemplateManager::include', array(&$this, &$params))) {
         return parent::_smarty_include($params);
     }
     return false;
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:11,代码来源:PKPTemplateManager.inc.php

示例8: array

 function _smarty_include($params)
 {
     $filename = '/app/views/' . $params['smarty_include_tpl_file'] . '.html';
     $filename = str_replace(array('//', '.html.html'), array('/', '.html'), $filename);
     if (file_exists(ROOT_DIR . $filename)) {
         $params['smarty_include_tpl_file'] = ROOT_DIR . $filename;
     } else {
         if (file_exists(BASE_DIR . $filename)) {
             $params['smarty_include_tpl_file'] = BASE_DIR . $filename;
         } else {
             if (file_exists(ROOT_DIR . 'page/' . $filename)) {
                 $params['smarty_include_tpl_file'] = ROOT_DIR . 'page/' . $filename;
             } else {
                 if (file_exists(BASE_DIR . 'page/' . $filename)) {
                     $params['smarty_include_tpl_file'] = BASE_DIR . 'page/' . $filename;
                 }
             }
         }
     }
     parent::_smarty_include($params);
 }
开发者ID:nonfiction,项目名称:nterchange,代码行数:21,代码来源:n_view.php

示例9: array

 /**
  * called for included templates
  *
  * @param array $params Smarty parameters
  *
  * @return void
  */
 function _smarty_include($params)
 {
     $tpl_file = $params["smarty_include_tpl_file"];
     $vars = $params["smarty_include_vars"];
     $skip_files = array("login.tpl", "common.tpl", "header.tpl", "footer.tpl", "tabbox.tpl", "ajax_errors.tpl");
     // Only at debug time
     if (!CAppUI::pref("showTemplateSpans") || isset($params["smarty_include_vars"]['nodebug']) || in_array(basename($tpl_file), $skip_files)) {
         parent::_smarty_include($params);
         return;
     }
     $this->showDebugSpans($tpl_file, $params);
     echo "\n<!-- Start include: {$tpl_file} -->\n";
     parent::_smarty_include($params);
     echo "\n<!-- Stop include: {$tpl_file} -->\n";
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:22,代码来源:CSmartyMB.class.php

示例10: _smarty_include

 public function _smarty_include($params)
 {
     // strip custom:
     $path = substr($params['smarty_include_tpl_file'], 7);
     ob_start();
     parent::_smarty_include($params);
     $output = ob_get_contents();
     ob_end_clean();
     echo $this->application->getRenderer()->applyLayoutModifications($path, $output);
 }
开发者ID:saiber,项目名称:www,代码行数:10,代码来源:LiveCartSmarty.php

示例11: array

 function _smarty_include($params)
 {
     global $ars_hooks;
     $pre = $post = $replace = array();
     $orig_file = $params['smarty_include_tpl_file'];
     $bench_id = cw_bench_open_tag($orig_file, 'tpl');
     if (is_array($ars_hooks['tpl'][$orig_file]) && !$params['smarty_include_vars']['disable_hooks']) {
         foreach ($ars_hooks['tpl'][$orig_file] as $type => $files) {
             foreach ($files as $file) {
                 if ($orig_file == $file[0]) {
                     continue;
                 }
                 // skip loop in hooks
                 $file[2] = $type;
                 $file[0] = $file[0];
                 if (!isset($file[1]) || $this->_tpl_vars[$file[1]] || function_exists($file[1]) && cw_call($file[1], array(&$params['smarty_include_vars'])) || strpos($file[1], '.tpl') !== false && $this->_tpl_vars['_current_compiled_file'] == $file[1]) {
                     switch ($type) {
                         case 'replace':
                             $replace[] = $file;
                             break;
                         case 'pre':
                             $pre[] = $file;
                             break;
                         case 'post':
                             $post[] = $file;
                             break;
                     }
                 }
             }
         }
     }
     if (empty($replace)) {
         $replace[] = array($orig_file, '', 'original');
     }
     $include_files = array_merge($pre, $replace, $post);
     foreach ($include_files as $file) {
         if (in_array($file[2], array('pre', 'post', 'replace'))) {
             $params['smarty_include_tpl_file'] = $file[0];
             $this->_smarty_include($params);
         } elseif ($file[2] == 'original') {
             $params['smarty_include_tpl_file'] = $file[0];
             if (!$this->template_exists($params['smarty_include_tpl_file'])) {
                 continue;
             }
             // skip non-existent tpl if it has hooks
             parent::_smarty_include($params);
         }
     }
     cw_bench_close_tag($bench_id);
 }
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:50,代码来源:templater.php

示例12: _smarty_include

 /**
  * Переопределение функции _smarty_include для собтсвенных нужд
  * @param array $params массив параметров
  * @return mixed если возвращает
  */
 public function _smarty_include($params)
 {
     $this->prefetch($params['smarty_include_tpl_file']);
     $r = parent::_smarty_include($params);
     $this->postfetch($params['smarty_include_tpl_file']);
     return $r;
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:12,代码来源:class.tpl.php

示例13:

 function _smarty_include($params)
 {
     if (isset($params['smarty_include_tpl_file'])) {
         $params['smarty_include_tpl_file'] = $this->getLocalOverride($params['smarty_include_tpl_file'], false);
         // Change resource_name to absolute path so that Smarty caching must take into account the theme directory
         $params['smarty_include_tpl_file'] = $this->convertToAbsolutePath($params['smarty_include_tpl_file']);
     }
     return parent::_smarty_include($params);
 }
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:9,代码来源:Interface.php

示例14:

	function _smarty_include($params){
		$tpl_inc = $params['smarty_include_tpl_file'];
		if(!file_exists($this->template_dir.$tpl_inc)){
            $tpl_name=JPATH_COMPONENT_SITE.DS.'templates'.DS.'default'.DS.$tpl_inc;
    		$params['smarty_include_tpl_file'] = $tpl_name;
        }
		parent::_smarty_include($params);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:8,代码来源:front.smarty.php


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