Home > Backend Development > PHP Tutorial > CI框架常用方法小结_PHP

CI框架常用方法小结_PHP

WBOY
Release: 2016-05-27 10:18:20
Original
739 people have browsed it

本文实例讲述了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>

Copy after login

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

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

Copy after login

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

四、模型中调用CI对象

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

Copy after login

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

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

Related labels:
source:php.cn
Previous article:ThinkPHP连接Oracle数据库_PHP Next article:php生成酷炫的四个字符验证码_PHP
Statement of this Website
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
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template