當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。