CI中view的重写代码
2015-02-05来源:易贤网

<!--?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**

* common class

*

* @package default

* @author mark

**/

class common extends CI_Controller {

public function __construct(){

parent::__construct();

}

/**

* 重写view 使能改变模板文件后缀等

*

* @return void

* @author meigong

**/

function view($file, $data, $flag = false){

if (true === $flag) {

return $this--->load-&gt;view($file.'.tpl', $data, true);

}else {

echo $this-&gt;load-&gt;view($file.'.tpl', $data, true);

}

}

}

?>

更多信息请查看IT技术专栏

2026公务员·事业单位培训课程试听报名

  • 报班类型
  • 姓名
  • 手机号
  • 验证码
推荐信息