TemplateMobile.class.php 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2013 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: luofei614<weibo.com/luofei614>
  10. // +----------------------------------------------------------------------
  11. defined('THINK_PATH') or exit();
  12. /**
  13. * MobileTemplate模板引擎驱动
  14. * @category Extend
  15. * @package Extend
  16. * @subpackage Driver.Template
  17. * @author luofei614 <weibo.com/luofei614>
  18. */
  19. class TemplateMobile {
  20. /**
  21. * 渲染模板输出
  22. * @access public
  23. * @param string $templateFile 模板文件名
  24. * @param array $var 模板变量
  25. * @return void
  26. */
  27. public function fetch($templateFile,$var) {
  28. $templateFile=substr($templateFile,strlen(THEME_PATH));
  29. $var['_think_template_path']=$templateFile;
  30. exit(json_encode($var));
  31. }
  32. }