Home >Web Front-end >JS Tutorial >CI框架常用方法小结_php实例

CI框架常用方法小结_php实例

WBOY
WBOYOriginal
2016-06-07 17:07:07856browse

本文实例讲述了CI框架常用方法。分享给大家供大家参考,具体如下:

一、在模板文件中加载css、js文件:

<link rel="stylesheet" type="text/css" href="<&#63;=base_url('css/style.css')&#63;>" />
<link rel="stylesheet" type="text/css" href="<&#63;=base_url('js/kindeditor/themes/default/default.css')&#63;>" />
<link rel="shortcut icon" href="<&#63;=base_url('images/favicon.ico')&#63;>" />
<script type="text/javascript" src="<&#63;=base_url('js/jquery.min.js')&#63;>"></script>
<script type="text/javascript" src="<&#63;=base_url('js/admin.public.js')&#63;>"></script>
<script type="text/javascript" src="<&#63;=base_url('js/jquery.artDialog.js&#63;skin=default')&#63;>"></script>
<script type="text/javascript" src="<&#63;=base_url('js/datejs/WdatePicker.js')&#63;>"></script>
<script type="text/javascript" charset="utf-8" src="<&#63;=base_url('js/kindeditor/kindeditor-min.js')&#63;>"></script>

二、在模板文件中加载子模板文件:

<&#63;php $this->load->view('admin_head.php');&#63;>
<&#63;php $this->load->view('admin_foot.php');&#63;>

三、模板文件中可以直接使用函数调用数据

四、模型中调用CI对象

$CI =& get_instance();
$CI->load->model('Data_model');

更多关于CodeIgniter相关内容感兴趣的读者可查看本站专题:《codeigniter入门教程》、《CI(CodeIgniter)框架进阶教程》、《php优秀开发框架总结》、《ThinkPHP入门教程》、《ThinkPHP常用方法总结》、《Zend FrameWork框架入门教程》、《php面向对象程序设计入门教程》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》

希望本文所述对大家基于CodeIgniter框架的PHP程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn