本文整理匯總了PHP中iPHP::iTPL方法的典型用法代碼示例。如果您正苦於以下問題:PHP iPHP::iTPL方法的具體用法?PHP iPHP::iTPL怎麽用?PHP iPHP::iTPL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iPHP
的用法示例。
在下文中一共展示了iPHP::iTPL方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: iTemplate
public static function iTemplate()
{
self::$iTPL = new iTemplate();
self::$iTPL->template_callback = array("iPHP", "tpl_path");
self::$iTPL->template_dir = iPHP_TPL_DIR;
self::$iTPL->compile_dir = iPHP_TPL_CACHE;
self::$iTPL->left_delimiter = '<!--{';
self::$iTPL->right_delimiter = '}-->';
self::$iTPL->register_modifier("date", "get_date");
self::$iTPL->register_modifier("cut", "csubstr");
self::$iTPL->register_modifier("htmlcut", "htmlcut");
self::$iTPL->register_modifier("cnlen", "cstrlen");
self::$iTPL->register_modifier("html2txt", "html2text");
self::$iTPL->register_modifier("key2num", "key2num");
//self::$iTPL->register_modifier("pinyin","GetPinyin");
self::$iTPL->register_modifier("unicode", "get_unicode");
//self::$iTPL->register_modifier("small","gethumb");
self::$iTPL->register_modifier("thumb", "small");
self::$iTPL->register_modifier("random", "random");
}
示例2: template_start
public static function template_start()
{
self::import(iPHP_CORE . '/iTemplate.class.php');
self::$iTPL = new iTemplate();
self::$iTPL->template_callback = array("iPHP", "tpl_path");
self::$iTPL->template_dir = iPHP_TPL_DIR;
self::$iTPL->compile_dir = iPHP_TPL_CACHE;
self::$iTPL->left_delimiter = '<!--{';
self::$iTPL->right_delimiter = '}-->';
self::$iTPL->register_modifier("date", "get_date");
self::$iTPL->register_modifier("cut", "csubstr");
self::$iTPL->register_modifier("htmlcut", "htmlcut");
self::$iTPL->register_modifier("cnlen", "cstrlen");
self::$iTPL->register_modifier("html2txt", "html2text");
self::$iTPL->register_modifier("key2num", "key2num");
//self::$iTPL->register_modifier("pinyin","GetPinyin");
self::$iTPL->register_modifier("unicode", "get_unicode");
//self::$iTPL->register_modifier("small","gethumb");
self::$iTPL->register_modifier("thumb", "small");
self::$iTPL->register_modifier("random", "random");
self::$iTPL->register_modifier("fields", "select_fields");
self::$iTPL->register_block("cache", array("iPHP", "tpl_block_cache"));
}