ここの情報は古いです。ご理解頂いた上でお取り扱いください。

source: OpenPNE/branches/kunitada/MyNETS/trunk/webapp/lib/smarty_plugins/function.ext_include.php @ 3043

Last change on this file since 3043 was 3043, checked in by kunitada, 16 years ago

MyNETS1.0.1 merge

File size: 1.7 KB
Line 
1<?php
2
3/* ========================================================================
4 *
5 * @license This source file is subject to version 3.01 of the PHP license,
6 *                      that is available at http://www.php.net/license/3_01.txt
7 *                      If you did not receive a copy of the PHP license and are unable
8 *                      to obtain it through the world-wide-web, please send a note to
9 *                      license@php.net so we can mail you a copy immediately. 
10 *
11 * @category   Application of MyNETS
12 * @project    OpenPNE UsagiProject 2006-2007
13 * @package    MyNETS
14 * @author     UsagiProject <info@usagi.mynets.jp>
15 * @copyright  2006-2007 UsagiProject <author member ad http://usagi.mynets.jp/member.html>
16 * @version    MyNETS,v 1.0.0
17 * @since      File available since Release 1.0.0 Nighty
18 * @chengelog  [2007/02/17] Ver1.1.0Nighty package
19 * ========================================================================
20 */
21
22/**
23 * OpenPNE
24 * @copyright 2005-2006 OpenPNE Project
25 * @link      http://www.tejimaya.com/openpne.shtml
26 *
27 */
28
29
30/**
31 * Smarty {ext_include} function plugin
32 * 組み込み関数 include のextディレクトリ対応版
33 *
34 *   {include file="**"}
35 *  なる部分を
36 *   {ext_include file="**"}
37 *  とすればOK
38 */
39function smarty_function_ext_include($params, &$smarty)
40{
41    $place = '';
42    $template = $smarty->templates_dir . '/' . $params['file'];
43
44    // 拡張ファイルチェック
45    if (!$tpl = $smarty->ext_search($template, $place)) {
46        $smarty->trigger_error('ext_include: tpl file not found. '.$tpl);
47        return;
48    }
49    $tpl = 'file:' . $tpl;
50
51    $params['smarty_include_tpl_file'] = $tpl;
52    $params['smarty_include_vars'] = array();
53    $smarty->_smarty_include($params);
54    return;
55}
56
57?>
Note: See TracBrowser for help on using the repository browser.